A

Admin • 833K Points
Coach

Q. What will be the output?

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

Explanation by: Admin

1 + '1' = '11'; '11' - 1 = 10 due to coercion.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.