Q. Which of the following is a correct way to declare a variable in JavaScript?

  • (A) var myVar;
  • (B) int myVar;
  • (C) let: myVar;
  • (D) declare myVar;
πŸ’¬ Discuss
βœ… Correct Answer: (A) var myVar;
Explanation: The correct syntax to declare a variable is using var, let, or const. 'var myVar;' is correct.
Explanation by: Chandani
The correct syntax to declare a variable is using var, let, or const. 'var myVar;' is correct.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
79
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Chandani
Publisher
πŸ“ˆ
99%
Success Rate