Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

To subclass, can't use var Programmer = Person() but need var Programmer = Person({}) ?

$
0
0
It seems that to subclass in can.js, we can use

  1. var Programmer = Person({}); 

and can't use

  1. var Programmer = Person(); 

Is it just a convention, or supposedly it seems that Person() can see that there is no argument and still do the same as what Person({}) does?  (which is to return a constructor function for the subclass).




Viewing all articles
Browse latest Browse all 3491

Trending Articles