DEV Community

Discussion on: Do You Still Use Var? If So Why?

Collapse
 
mateiadrielrafael profile image
Matei Adriel

Am I the only one who thinks const should be the only thing used?

Collapse
 
kmwill23 profile image
Kevin

I am genuinely interested in your thoughts here

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
muttsuri profile image
Muttsuri

I would like to note that const doesn't provide imutability, it only protects against reassignment

Thread Thread
 
mateiadrielrafael profile image
Matei Adriel

Ofcourse, const isn't enough, but it's a starting point

Thread Thread
 
Sloan, the sloth mascot
Comment deleted
 
mateiadrielrafael profile image
Matei Adriel

I'd argue you shouldn't add props to an object after you create it

Collapse
 
mateiadrielrafael profile image
Matei Adriel

I'd argue you should never have any value change (not in the foo = bar sense of change)