Why you shouldn't reassign values
In JavaScript, you can reassign values to variables you declared with let or var.
I used to reassign values a lot. But as I got better with JavaScript, I realized you shouldn’t reassign values if you can. This is because:
- You may change external state by accident when you reassign values
- You create more complex code when you reassign values
You can find out more about why you shouldn’t reassign, and what to do instead in today’s article.
Enjoy!
https://zellwk.com/blog/dont-reassign
Stay awesome,
Zell
P.S. Enrollment for Learn JavaScript is opening in three weeks! I’m super excited share it with you again. Look forward to more information soon! 🤓.