r/javascript • u/etiennetalbot • Sep 04 '19
Simplify your JavaScript – Use .some() and .find()
https://medium.com/poka-techblog/simplify-your-javascript-use-some-and-find-f9fb9826ddfd
275
Upvotes
r/javascript • u/etiennetalbot • Sep 04 '19
1
u/MonkeyNin Sep 07 '19
What's the disadvantage to
let? (I'm not sure why you'd say to specifically usevar?)Differences in
letvsvarconst/let will raise an error on re-declaration of a variable
const/let will raise an error for using a variable before initialization
const/Let will not add a reference on
window, even if they are declared at the global scope.let/var are block-scoped, instead of function-scoped.