Friday, September 18, 2015

It's a convention in JavaScript to name classes in Pascal case instead of camel case.

But of course, they are not really classes. In this example though...

var bar = new foo();

 
 

...the function the foo function corresponds to should probably have been named Foo not foo if the author envisioned it being used in this manner. Again, this is all just goofy tomfoolery as there are no classes in JavaScript. This note about conventions comes from Kyle Simpson's book "this & OBJECT PROTOTYPES" which is all about JavaScript.

No comments:

Post a Comment