At the moment I’m studying functions, and I cannot really find out what’s wrong with the following code.
No matter what value “password” takes I always get “NICE”
var passValid = function (password) {
return password.length;
};
if (passValid<5){
console.log("ERROR");
}
else{
console.log("NICE");
}
passValid("somevalue");
I think you want:
I’m not sure how to describe why your original code is wrong; it’s just sort-of off in the weeds 🙂