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

Re : Remove 'new' keyword when creating a can.Observe

$
0
0
To expand on sebasporto's comment, all of CanJS' classes have this same behavior.

For Example, can.Construct, can.Control and can.Model are extended by not using new. To create an instance of one of these you use new. One slight difference is that the unextended Construct, Control and Model don't do anything useful without being extended, so you never see:
  1. var model = new can.Model();
Whereas the unextended can.Observe and can.Observe.List are very useful without being extended.

Viewing all articles
Browse latest Browse all 3491

Trending Articles