JavaScript JavaScript Basics (Retired) Storing and Tracking Information with Variables The Variable Challenge

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!

//Variable list

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.");

Any recommendations?

2 Answers

Steven Parker
Steven Parker
203,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.

Thank you!

Jazz Jones
Jazz Jones
8,535 Points

The lower case method should be noun.toLowerCase(); you didn't capitalize the 'L' in any of your methods.