Code your own adventure 3/6


My code:

var user = prompt("What's your name?");
var user = prompt("Are you going to FIGHT, RUN,HIDE").toUpperCase();

My error:

TypeError: Cannot read property 'toLowerCase' of null


This means that the prompt() function returned null, therefore it has no toUpperCase() function on it.

Make sure that you're actually entering a value for the second prompt.

What's further, make sure you are going to use different variables for each prompt as you are storing input. Setting both to user is overwriting the first.