Q. What will be logged?

Code:
console.log('2' - '1');
  • (A) 1
  • (B) 11
  • (C) NaN
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) 1
Explanation: The - operator coerces both strings to numbers.
Explanation by: Chandani
The - operator coerces both strings to numbers.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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