πŸ“Š JavaScript
Q. What will be the output of the following code?
Code:
console.log(2 + '2');
  • (A) 4
  • (B) 22
  • (C) NaN
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 22

Explanation: JavaScript coerces the number 2 to a string and concatenates, resulting in '22'.

Explanation by: Chandani
JavaScript coerces the number 2 to a string and concatenates, resulting in '22'.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
50
Total Visits
πŸ“½οΈ
9 mo ago
Published
πŸŽ–οΈ
Chandani
Publisher
πŸ“ˆ
86%
Success Rate