πŸ“Š JavaScript
Q. In JavaScript which of the following is used to declare variable
  • (A) var
  • (B) dim
  • (C) function
  • (D) const
πŸ’¬ Discuss
βœ… Correct Answer: (A) var

Explanation:

The correct answer is both (A) var and (D) const.

But since only one option is usually expected, (A) var is the traditional and direct answer.

Explanation:

  • var is the original way to declare variables in JavaScript.
  • const (and let) were introduced later (in ES6) for better control.
  • dim is from VBScript, not JavaScript.
  • function is used to declare a function, not a variable.

Explanation by: Mr. Dubey

The correct answer is both (A) var and (D) const.

But since only one option is usually expected, (A) var is the traditional and direct answer.

Explanation:

  • var is the original way to declare variables in JavaScript.
  • const (and let) were introduced later (in ES6) for better control.
  • dim is from VBScript, not JavaScript.
  • function is used to declare a function, not a variable.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
241
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Yatendra Sir
Publisher
πŸ“ˆ
87%
Success Rate