Simple, but the most asked interview question in JavaScript,

Simple, but the most asked interview question in JavaScript, and its answer will drive your whole interview. Easy, but most students miss this one,
Let me clear all your doubts about var, let, and const.
I have given you some points that you can mention in the interview. The Interviewer might impress you, and these points help you to drive your interview yourself.
Let's start,
☑️ These help to declare the variable in JavaScript,
☑️ Var is the old method to declare (there is another fault using Var ),
and let and const are the modern methods to declare a variable,
☑️var is the function scope (learn about scope in JavaScript)
☑️var can be reassigned and redeclared, var can be hoisted and accessible as undefined if used before its declaration; let and const are block-scope (only in {} )
☑️ let can not be redeclared within the same scope, but can be reassigned. Const can not be redeclared and reassigned
☑️ All three are hoisted, var is hoisted to the top of its function and initialized as Undefined, let and const are also hoisted, but stay in the Temporal Dead Zone
☑️var and let are mutable, whereas const is immutable
These 7 points help you to show, you know the fundamentals of JavaScript.
🔑 Note: Clear all the Keywords used in this answer before the interview. This is a simple answer in 10 points. Read once you will never forget
📚 Here are some resources you can visit for clearer answers:
☕ Chai Aur Code: [https://lnkd.in/gscYppmJ
🙏](https://lnkd.in/gscYppmJ🙏) Namaste JavaScript: [https://lnkd.in/grfwJRbf
](https://lnkd.in/grfwJRbf)🤓 GFG: [https://lnkd.in/gvYsd4X6
](https://lnkd.in/gvYsd4X6)💬 What is your answer to this particular question? Let us discuss it in [the comments.
hash](https://www.linkedin.com/search/results/all/?keywords=%23chaiaurcode&origin=HASH_TAG_FROM_FEED)tag#chaiaurcode Hitesh ChoudharyAkshay Saini 🚀 hashtag#namastejavascript hashtag#interviewquestion hashtag#javascript hashtag#programming hashtag#javascriptinterviewquestion
Subscribe to my newsletter
Read articles from hackthic directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
