ReferenceError: hasUpperCase is not defined


#1

Whenever I run my code I get a ReferenceError. Any idea what the issue could be? I just completed step 5/14 and am stuck on step 6. Thanks

`
function hasUpperCase(input) {
for (var i = 0; i < input.length; i++) {
return true;
if (input[i] ===
input[i].toUpperCase()) {
return true;
}

}
}

function isPasswordValid(input) {
if (hasUppercase(input)) {
console.log('The password is valid.');
return true;
}

}

isPasswordValid('MelloYello');`


#2

That line may be removed from just inside the loop body. At the end of the function body,

return false;

You are only checking for at least one uppercase letter so as soon as one is found, true is returned. You'll only want to return false if the loop completes executing.

This should be on one line. It may be that the function is not being parsed and hoisted so raised the ReferenceError.