A part of my own code won't work


#1



When typing just one letter it won't jump to the else part, but prints out the if output


var name = prompt("What is your name Sir/Miss?");
if ( name.length < 2 ) {
    console.log("Okay " + name + " then let's quickly accomplish this tutorial");
}
else {
    console.log("Sorry, " + name + " is not a valid name. It must atleast include 3 letters")
}


#2

Okay, nevermind. I just put "<" instead of ">"


#3

I think u are also missing a ; at the end of the second console.log but thats just me.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.