I agree with you that in modern JS - the use of var is not recommended. When creating apps - I also use let and const only. I don't know about the world but it's still asked in interviews in India. Big companies like Flipkart (acquired by Walmart) have it in one form or the other in their interviews.
Besides interviews - I can think of one possible reasons as to why one should know how things happen with var - to not get confused when they encounter it on the web in some old codebase.
Your answer is crisp and to the point - taking advantage of all new ES6+ features.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey,
Thank you for taking the time to comment.
I agree with you that in modern JS - the use of var is not recommended. When creating apps - I also use let and const only. I don't know about the world but it's still asked in interviews in India. Big companies like Flipkart (acquired by Walmart) have it in one form or the other in their interviews.
Besides interviews - I can think of one possible reasons as to why one should know how things happen with var - to not get confused when they encounter it on the web in some old codebase.
Your answer is crisp and to the point - taking advantage of all new ES6+ features.