You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sam Matthews edited this page May 22, 2015
·
4 revisions
#Javascript Conventions
General Code Style
varourStyleGuide={/* ** ** This comment relates to a block of code. It's usually written ** above a function. ** */fooBar: function(pow,whamo){// Spaces between 'function' and parenthesis, spaces between args and parenthesis// A double slashed comment above a line explains following line's purposeconsole.log("Doing something");// Double slashed comment after command clarifies functionality// TODO: Comments like these are used to comment on needs for refactor or raise questions}}
For Loops
// when working with objectsfor(varxiny){ ... }// when working with arraysfor(varx;x<y.length;x++){ ... }