JavaScript Variables & Constants Interview Questions – JavaScript Variables & Constants Online Quiz

Question 1:  Which keyword is used to declare a variable in JavaScript?

Question 2:  What is the main difference between var and let?

Question 3:  Which statement is true about const variables in JavaScript?

Question 4:  What will happen if you try to redeclare a let variable in the same scope?

Question 5:  What is the scope of a var variable?

Question 6:  What will be the output of the following code?

Question 7:  Can a const variable hold an object that can be modified?

Question 8:  What happens if you try to use a variable before declaring it with let?

Question 9:  Which of the following is NOT a valid variable name in JavaScript?

Question 10:  What is the default value of an uninitialized let variable?

Leave a Reply