1579Re: [jslint] Re: ES5 and constructors
- Nov 4, 2010But I read that invoking a constructor in ES5 without using the "new"
keyword is an error. If that is true then there must be some way to
distinguish between constructor functions and non-constructor functions. If
the case of the first letter is how it is done, then it is more than just a
convention in ES5.
On Thu, Nov 4, 2010 at 3:40 PM, Stefan Weiss <weiss@...> wrote:
> On 04/11/10 19:42, Mark Volkmann wrote:
> > Thanks! I'm trying to verify though that in ES5, not just in JSLint, the
> > definition of a constructor is "a function whose name starts with an
> > uppercase letter".
> In ES5 (same as in ES3), a constructor is simply a function which
> creates and initializes objects. Letter case has nothing to do with it.
> Starting function names with an uppercase letter is just a common
> convention to distinguish their role as constructors from other
> non-constructor functions.
R. Mark Volkmann
Object Computing, Inc.
[Non-text portions of this message have been removed]
- << Previous post in topic Next post in topic >>