Timeline for Is duplicate syntax for defining named functions a bad language design decision?
Current License: CC BY-SA 3.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 12, 2016 at 21:36 | comment | added | B T | @mpen Yeah, actually javascript essentially does the same thing. the function fnName()... form does in fact create a constant, which is what makes hoisting a valid thing to do with it. Javascript makes things pretty confusing tho when you use the form var fn = function anotherFnName()... since that makes the name anotherFnName not hoist, even tho its clearly constant. | |
| Apr 12, 2016 at 5:52 | comment | added | mpen | That's quite interesting that const causes hoisting, but it makes perfect sense. In JS function myFunc causes hoisting, but var myFunc = does not, which is perhaps a bit less intuitive because they behave pretty much the same otherwise. | |
| Jul 16, 2014 at 19:34 | history | edited | B T | CC BY-SA 3.0 | deleted 1 character in body |
| Jul 16, 2014 at 18:53 | history | answered | B T | CC BY-SA 3.0 |