I have listed down some commonly asked JS-based interview questions.
1. What's the difference between var, let and const
https://www.educative.io/answers/difference-between-var-let-and-const-keyword-in-javascript
- var and let can be reassigned while const can't be reassigned.
- var can be redeclared while let and const can't.
- var has function scope, let and const have block scope.
- Hoisting allowed in var but not in let and const.
2. What is hoisting? and hosting related coding questions.
https://www.digitalocean.com/community/tutorials/understanding-hoisting-in-javascript
Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution.
hoisting is not allowed in let and const.
3. What is a Closure?
https://www.javascripttutorial.net/javascript-closure/
Closure refers to the concept in which a nested function has access to the variables declared in it, variables declared in the parent function and variables present in the global scope.
The variables then can be accessed even if the outer function has completed its execution.
4. Explain event loop?
https://stackoverflow.com/questions/21607692/understanding-the-event-loop
It's a big topic, so I will suggest reading the answers from the pasted Stackoverflow link.
In short, I will say event loop is the concept using which js is able to perform async operations smoothly.
Thanks for reading 🎉 , I will keep adding more questions.