Javascript so far #1

Javascript so far #1

Dec 19, 2020

Use semicolons to end statements;

Use let and const to avoid globals;

Always assign to let and const;

Hoisting is just bizarre: just avoid it;

Do not reassign const objects or const arrays: const shouldn't change;

Number can be integer or floating point =s

Don't reassign to different data types: it introduces bugs;

Plus (+) operator converts number to strings ('37'+7='377'); other operators don't ('37'-7=30) =s

Specify all elements in your array, please.

Numeric literal as the name of a property is weird. Just go with something valid to be accessed by a dot (".");

Interpolation? Yes. Except backtick is weird...

Enjoy this post?

Buy fmachs a book

More from fmachs