ExamVeda
Login
Home
This question belongs to Javascript Classes And Modules
Classes and Modules
?

Consider the following code snippet
let x=x+1;
console.log(x);
What will be the result for the above code snippet?

Answer & Solution
Correct Answer: Option D
Since x is a let variable and since x is undefined, so x+1 is NaN. Thus, the above code snippet prints NaN.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.