5 ms·
I've seen a majority of sources abandon the function keyword entirely in favor of const arrow declarations (and shorthand method syntax). FWIW I personally lik
by mLuby 6y ago
I've seen a majority of sources abandon the function keyword entirely in favor of const arrow declarations (and shorthand method syntax).
FWIW I personally like the function keyword, since it's clear what it is to non-JS readers, but primarily because it hoists to the top of its file, so unimportant utility functions can sit unobtrusively at the end of the file, thereby letting readers encounter more important logic earlier in the file.
- genrez 6y agoInteresting to know that what the article recommends is indeed the industry standard. I'd forgotten about hoisting until you brought it up!
- deleted 6y ago[deleted]