A

Admin • 825.56K Points
Coach

Q. What will be logged?

Code:
let a = 1;
let b = a++;
console.log(b);
  • (A) 2
  • (B) 1
  • (C) undefined
  • (D) NaN
  • Correct Answer - Option(B)
  • Views: 6
  • Filed under category JavaScript
  • Hashtags:

Explanation by: Admin
Post-increment returns the value before incrementing.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.