During these days I see many articles about this "stuff" declarations war.
I think we can summarise everything in a few lines:
-
var
: why? if you can avoid it, do it; - prefer
const
usage if possible of course (together with an immutable approach when updating objects)! But don't be scared usinglet
, especially if the scope of your variables is small, for example inside a function.
Immutable things are cool when they really help, but just keep in mind that (imho) the most important thing is to have maintainable and readable software because we are a community of devs, teammates.
Happy new year! 🎉
Top comments (1)
Sorry 😂