Search posts, tags, users, and pages
Is it true that const makes a variable immutable?
Tiger Abrodi
@tigerabrodi · Germany
Obsessed with crafting software.
Just a guy who loves to write code and watch anime.
Markdown supported · ⌘↵ to post
Ákos Kőműves
This topic is strange to me, probably because, by default, I write const. I don't know why. 😄
There's also a linter rule that fixes all your unnecessary let usages eslint.org/docs/latest/rules/prefer-const.
Thilakmani
Nice Point
Lucas Gazzola
Great article. It makes a point. And always remember, don't use var anymore.
fosho, the ones ive seen using var in today's age are those that have like 15+ yrs of experience and don't code in JS that often lmao
Maxi Contieri
Reassignments are wrong, they are a code smell, and they aren't good to write, avoid them whenever you can.
Exactly!
I had to get it clear haha
let just be confusing stuff, making you think reassignments happen everywhere
Muphet
let and const have block scope, var doesn't. there still are cases that you need to pass variables out of blocks
Ákos Kőműves
This topic is strange to me, probably because, by default, I write const. I don't know why. 😄
There's also a linter rule that fixes all your unnecessary let usages eslint.org/docs/latest/rules/prefer-const.