Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
fathia
5,555 PointsThe variable challenge .. My solution
This is my version:
I kept it simple with just asking for noun(rooster) and verb(crow).
// Code Starts
var noun = prompt("Please type a noun"); var verb = prompt("Please type a verb"); alert("You are done!");
var story = "Once, there lived a " + noun.toLowerCase(); story += " in a village. His job was to " + verb.toLowerCase(); story += " in the morning every day at sunrise."; document.write("<h2 style = 'color: gray;'>" + story + "</h2>");
// Code Ends
I thought that the user may use Uppercase and it should be lowercase so I used
.toLowerCase()
method.
I am happy with putting knew knowledge on work.
All the best to all of you. Happy learning ^_^
1 Answer
fathia
5,555 PointsThank you Calin.
Calin Bogdan
14,921 PointsCalin Bogdan
14,921 PointsGreat idea! Very nicely done!