Hacker News new | ask | show | jobs
by mLuby 1881 days 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.

1 comments

Interesting to know that what the article recommends is indeed the industry standard. I'd forgotten about hoisting until you brought it up!