A

Admin • 832.27K Points
Coach

Q. What will the code output?

Code:
console.log([] + []);
  • (A) []
  • (B) undefined
  • (C) NaN
  • (D) ""
  • Correct Answer - Option(D)
  • Views: 12
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin
[] + [] results in an empty string because both are coerced to strings.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.