News for hackers. Stuff that matters.
Re:Arrow Functions Coming to Chrome 45 by paublyrne on Monday June 22, 2015 @02:17PM (#9760183)
No offence taken, but what about let do you think is wrong for JavaScript? It will help make common scope errors less common, and is clean to read.
Re:Arrow Functions Coming to Chrome 45 by apalmer on Monday June 22, 2015 @03:00PM (#9760448)
basically i feel like it greatly complicates the scoping rules in order to make javascript scoping similar to other languages scoping rules. If there was no 'var' I would be fine with 'let' and in theory perhaps 'let' is better than 'var', however if i had a choice between having both or having just one, i would rather just have either, even if the either is 'var'.
Re:Arrow Functions Coming to Chrome 45 by spb on Monday June 22, 2015 @08:29PM (#9762012)
If you think of `var` as a syntactic sugar for a `let` declaration that gets hoisted to the top of its containing function, `let` actually simplifies scoping.