convention - Names in JavaScript -
var = function () { this.someproperty = 0; }; var = new a();
the variable a
object. call a
? class?
a
called constructor function. well, specifically, a
variable refers constructor function, don't kind of mintuiae.
sometimes people call these "classes," because constructor functions aid in producing classes of objects (in general sense, e.g., objects common characteristics). javascript doesn't have classes in class-based oop sense java or c#, has different inheritance mechanism called prototypical inheritance. (this true in es2015 , beyond, keyword class
used define constructor function, properties of prototype assigns objects when used new
, , properties on function referring other functions ["static methods"].)
Comments
Post a Comment