Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following JavaScript code?
let x=x+1;
console.log(x);

What will be the output of the following JavaScript code?
let x=x+1;
console.log(x);
a) 0
b) null
c) Reference error
d) NaN

Answer: d
Explanation: x has not been defined with any value hence the value of x+1 will be Nan. Therefore the console.log function will print NaN.

Join The Discussion