News for hackers. Stuff that matters.
Re:JavaScript fundamentals before learning React by mygo on Thursday July 19, 2018 @11:59PM (#17572345)
maybe it’s because const is 2 more letters to type.

if “let” was “letitbe” I bet const would be more popular

seriously though, I wish they could have chosen a 3-letter word for const in keeping with var and let. I know const exists in other languages, but it doesn’t even mean the exact same thing as some other languages anyway.

Re:JavaScript fundamentals before learning React by dpwm on Friday July 20, 2018 @04:49AM (#17573441)
> I wish they could have chosen a 3-letter word for const in keeping with var and let.

"set" or "fix" would be quite nice, given what const actually does.

Re:JavaScript fundamentals before learning React by DonHopkins on Friday July 20, 2018 @07:34AM (#17574130)
I'm having one of those days when variables won't and constants aren't.
Re:JavaScript fundamentals before learning React by pygy_ on Friday July 20, 2018 @04:51AM (#17573445)
It would have been nice to have `let` work like `const` does, and something else for what is currently `let` (`mut`?).

The TC39 was constrained by the list of reserved words though. `let` and `const` were reserved in ES5, and there was nothing that could have conveyed `mut`.

https://mathiasbynens.be/notes/reserved-keywords#ecmascript-...

Re:JavaScript fundamentals before learning React by eip on Friday July 20, 2018 @05:33PM (#17579140)
Unrelated but didn't know how to contact you: https://www.youtube.com/watch?v=TdzIKD0oMzo
Re:JavaScript fundamentals before learning React by DonHopkins on Friday July 20, 2018 @07:33AM (#17574119)
How about balancing out every "let" with a "forbid" at the end of the block to mark the end of the scope?