31.
What will be the output of the following code?
let x = 5;
console.log(x++);
Syntax Error
4
6
5
Correct: D
The code will output 5 because the ++ operator is used as a postfix, meaning it increments the value of x after it is logged to the console. Therefore, the initial value of x (which is 5) will be logged before it is incremented.