Ask HN: What would you change about JavaScript if you could?
Ideally replies with a minimum of snark.
"Change the syntax to Python <or your favorite language>" isn't the sort of reply that would be helpful in this thread.
(
7 comments
| 4 points
| on HN
)
I also wish JavaScript were generally better at functional programming - I'd love to see a keyword that ensures that no form of mutation is possible within a given scope.
Function level scope would be great too - it would be good to conditionally declare and set variables in a function without needing to pre-declare the variable outside the condition test.
if foo === 'FOO' && bar > 7 {
}else if typeof foo === 'string'{ }return null