A

Admin • 828.03K Points
Coach

Q. What will be logged?

Code:
console.log('2' - '1');
  • (A) 1
  • (B) 11
  • (C) NaN
  • (D) Error
  • Correct Answer - Option(A)
  • Views: 7
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin
The - operator coerces both strings to numbers.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.