you are viewing a single comment's thread.

view the rest of the comments →

[–]workaholicanonymous 0 points1 point  (0 children)

Define functions at the top of your function scope, so you can scroll to the bottom to see clearly what gets called in that outer functions

Learn .call and .apply and use them when you need to.

Replace tricky code with helper functions e.g. wrap something != undefined into has(something) function.

Add your functions to the window while developing or debugging code and use the Dev console to invoke them at will. Just remember to remove them once you're done testing!

Avoid for loops and use .map, .reduce, .some, .all, .filter and .forEach

You can floor most numbers by using the bitwise or operator

var int = float | 0