DEV Community

Discussion on: Why you shouldn't reassign values in JavaScript

Collapse
 
shalvah profile image
Shalvah • Edited

Good article @zellwk . Another useful habit to cultivate is not allowing your functions to modify anything that wasn't created within it (or at the least, passed in as an argument). That way you won't have to worry too much about mistakenly reassigning something else.

Collapse
 
zellwk profile image
Zell Liew 🤗

Yup. Pure functions FTW.