Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

having Issues With The Math Object in JS

Hey, guys so I followed exactly what David said and it's not showing up the alerts can anyone help me out on this?

var questions = 3;
'[3questions left]'
var questionsLeft = ' [' + question +' questions left]';
var adjective = prompt('Please type an adjective' + questionLeft);
var verb = prompt('Please type a verb');
var noun = prompt('Please type a noun' + questionsLeft);
alert('All done. Ready for the message?');
var sentence = "<h2>There once was a " + adjective;
sentence += ' programmer who wanted to use JavaScript to ' + verb;
sentence += ' the ' + noun + '.</h2>';
document.write(sentence);

1 Answer

Dario Bahena
Dario Bahena
10,697 Points

The primary issue with your code is the spelling of some variables.

//                         questions
var questionsLeft = ' [' + question +' questions left]';
//                                                 questionsLeft
var adjective = prompt('Please type an adjective' + questionLeft);

Fix those lines and it will work.

Alrighty