However, I would like to come back to the statement “use var, let, const” — we should avoid using var in our code and always prefer let or const instead. 🙌
Maybe adding a note about the keywords:
- to create variables var, let, const are available
- but var should not be used due to legacy reasons, let and const should be used
Awesome explanation, thank you 😃
Thank you for the feedback, Ravi!
Thanks for covering these less-known but still super-important concepts, Petar!
🙌
Neat notes and recaps.
However, I would like to come back to the statement “use var, let, const” — we should avoid using var in our code and always prefer let or const instead. 🙌
Maybe adding a note about the keywords:
- to create variables var, let, const are available
- but var should not be used due to legacy reasons, let and const should be used
True! Thank you for the feedback! 🙏
I updated the message above as I feared I was not fully expressing my thought.
I meant this could benefits from a little note regarding the use of the keywords to create variables :)
That's exactly what happened to me not long ago and I did the same. I dived into articles and books to learn more about the insides of JS/TS.
It's part of the journey, I guess. But many people still skip the foundations even after similar failures.