DEV Community

Discussion on: Is`let` the new `var` in Javascript?

Collapse
 
oskarcodes profile image
Oskar Codes

const should always be used when you don’t need to change the value, and if that’s not possible, let should be used, but not var.

There are some edge cases where var is the only option, but you should avoid that.