Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

LEVEL 2 LESSON 2 JavaScript

Run the code given in the code editor, and you will see the following error in output:

Output:- ReferenceError: myVar is not defined

Move the console.log() statement, so that we do not get any error, and the output in the console shows the value of the myVar variable.

Note: Do not use the value of the variable directly in the console.log() function.
by

1 Answer

kshitijrana14
Try this one:

let myVar=10;
console.log(myVar);

Login / Signup to Answer the Question.