What is the output of the following JavaScript code? let x = 10;
What is the output of the following JavaScript code?
let x = 10;
if (x > 5) {
console.log("Greater");
} else {
console.log("Smaller");
}
Show answerHide answer
Correct answer: (C) "Greater"
Explanation
x is 10, so the condition x > 5 is true and console.log prints "Greater".