Consider following code:
var str;
var i = '0';
What will be printed to the console?
Variable str declared but no value was assigned. Technically it has the value of undefined. Example:

var name;
console.log(name); // undefined
name = "James";
console.log(name); // "James"

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
JavaScript quizzes
Sign Up Now
or Subscribe for future quizzes