When the user enters his name in the prompt, "Hello" + name is shown in the document. That is good. But when the user enters nothing, rather than showing "Feeling shy?" it is showing "Hello Null". I don't get it why. Even my course instructor wrote the same code as mine in the video lecture in her video and it works fine but when I copy the same code it's not working properly.
var name = prompt("What is your name?");
if (name.length != null) {
if (name == "Badar") {
document.write("What a beautiful name");
} else {
document.write("Hello " + name);
}
} else {
document.write("Feeling shy?");
}