toLowerCase(); gives me an ERROR



Gives me an error message as such:


ReferenceError: userInput is not defined
at Object.

Appreciate if someone can help. Thank you


This error is telling you the variable userInput is not defined in your code (or at least not in the scope).

userInput = userInput.toLowerCase(); //-> ReferenceError as `userInput` is not defined yet

For example:

var foo = 'Hello there'; //-> the variable is declared and initialized to a string
foo = foo.toLowerCase() //-> 'hello there'

Check your code for where you are declaring userInput before you try to use .toLowerCase().


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