Q. What is the default value of 'this' in a JavaScript class method?

  • (A) window
  • (B) undefined
  • (C) the class instance
  • (D) null
πŸ’¬ Discuss
βœ… Correct Answer: (C) the class instance
Explanation: In class methods, 'this' refers to the class instance.
Explanation by: Chandani
In class methods, 'this' refers to the class instance.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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