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

In level 2 - lesson 5

assign null value to variable myVar is done and in the console it is showing null as output but i cannt submit the answer
by

4 Answers

Abhisheke3yvz
The output should show both,
undefined and null
so you have to keep the first console.log statement, then set null to the myVar variable, and then again use the second console.log statement to log the value of the variable again.
Raju304kr
yeah i done it, even though i was getting same result.
var myVar =
console.log(myVar);
var myVar = null;
console.log(myVar);
Eventhough the answer is correct, it is displaying that - log the value of the variable myVar on the console.
iamabhishek
Second time, you don't have to use var keyword again, this should be the correct code:

var myVar;
console.log(myVar);

myVar = null;
console.log(myVar);
Raju304kr
can anyone tell me Assignment Operator code 3 level - 2 lesson.

Login / Signup to Answer the Question.