3 ms·
>>> You don't have to place variable declarations in the header! (they are hoisted) probably splitting hairs here but imo "hoisting" as in using variables befo
by ChemicalWarfare 10y ago
>>> You don't have to place variable declarations in the header! (they are hoisted)
probably splitting hairs here but imo "hoisting" as in using variables before they are declared is generally a bad practice especially considering that init assignments are not "hoisted".
>>>Arrow functions are very nice for one liners, but will ruin your code if you use them everywhere instead of named functions.
Based on arrow functions' relationship with "this" pretty sure the intent is to primarily use arrow functions instead of anonymous functions especially when passing them around as params. Even with one-liners you have to be wary of what "this" is when dealing with an arrow function inside of an object for example.