The Variable Challenge - Syntax Error
I am attempting 'The Variable Challenge activity' and seem to be encountering an error with my code that causes my program to stop after prompting for a noun. My goal for the program is to ask the user for a noun, change that input to lower case, and then output that lower cased form on the webpage. I want to repeat this for a verb and an adjective as well.
Any recommendations on what I'm doing wrong and why it is wrong? Thanks!
var noun; var verb; var adjective;
//Prompts for adlibs
noun = prompt("Type in a noun"); console.log(noun); noun = noun.tolowerCase();
verb = prompt("Type in a verb"); console.log(verb); verb = verb.tolowerCase();
adjective = prompt("Type in an adjective"); console.log(adjective); adjective = adjective.tolowerCase();
document.write("One day, " + noun + "decided to_" + verb + "_" + adjective + "down the street.");
Steven Parker203,226 Points
You have "tolowerCase" (little "l") instead of "toLowerCase" (capital "L") in 3 places.
Then just for appearance, you might want to add some spaces and remove the underscores from the strings in the final statement.
Jazz Jones8,535 Points
The lower case method should be noun.toLowerCase(); you didn't capitalize the 'L' in any of your methods.