> - What do you call something that produces instances in JavaScript? A class? 
> A type? A constructor? Or is a constructor the implementation of a type?
>  
> At least in my part of the everyday life of a JavaScript programmer, we call 
> functions that we invoke with "new" mostly "classes" and sometimes 
> "constructors". In contrast, values not objects are the ones that have types 
> (only boolean, number and string) even if values in JS are indeed objects.
> 
>  
> - If instance factory B inherits from instance factory A, is B a subclass of 
> A? B a subtype of A? B a subconstructor of A?
> 
> We say it's a subclass, but we mostly say "inherits from".

How about this (expanding your proposal)?
- Every value in JavaScript is an element (not an instance!) of a type.
- There are primitive types and object types.
- Object types are implemented via constructors/classes.
- A class/constructor produces objects that are its instances.
- A constructor inherits from another constructor.
- A class is a subclass of another class.

I wonder if the word class couldn’t be avoided (certainly not with class 
literals).

-- 
Dr. Axel Rauschmayer
[email protected]

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com



_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to