Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does ES6 make named function expressions unnecessary? [closed]

So after reading T.J. Crowder's answer to this question, it seems that the ES 6 spec has rules for inferring function names for anonymous functions bound to variable names. Do we still need to use named function expressions? It looks like ES6 makes it unnecessary.

like image 488
Mark Cuban Avatar asked Nov 08 '22 22:11

Mark Cuban


1 Answers

Not yet. There is no fully ES 6 compliant JS environment yet. Plus we'll have to support legacy browsers for years to come. However since one of the main points of using named function expressions is that you get better stack traces on errors, when and if implementations catch up to the ES 6 spec then as long as your development environment is compliant you may be able to get by without them.

like image 181
Jared Smith Avatar answered Nov 14 '22 21:11

Jared Smith