Top 5 JavaScript hacks that developers should know

Conditional shortcuts

1

JavaScript allows the use of these shortcuts to improve code readability.

Operator

2

You can use the ~~ operator instead of Math.floor(). 

Resizing an Array with array.length

3

You can always adjust the size of the Array through Array.length, often cutting it in half or even leaving it empty.

Default value with ||

4

Still using the shortcuts, you can have default values in case of inconsistency in variables or parameters.

Further exploring the console

5

You can, and even must, explore more of the console’s powers.