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 trialRwanda Muhammad
Full Stack JavaScript Techdegree Student 4,116 PointsThe code is not working
Did this code exactly, when viewing it said , "Lets make a Function" only, no random numbers.
Rwanda Muhammad
Full Stack JavaScript Techdegree Student 4,116 PointsSorry the M in Math.random was also a lower case, it works, Thanks
Piotr Manczak
Front End Web Development Techdegree Graduate 29,363 PointsAfter var randomNumber you supposed to place = instead of + That's the only mistake I can spot.
3 Answers
Matthew Long
28,407 PointsThere are a few differences in the code. First thing I notice is you're calling a function that doesn't exist. The function you made is alertrandom() but the function you call is alertRandom(). Math isn't capital either, and you're missing a semicolon, lastly there is a plus sign where there should be an equal sign.
You likely would have found these errors in your console if you check there!
Rwanda Muhammad
Full Stack JavaScript Techdegree Student 4,116 PointsI see it now, my mistake , thanks for the help. : )
Steven Parker
231,268 PointsMissing a semicolon? Where?
Matthew Long
28,407 PointsSorry Steven I only answered because I saw your answer only fixed one of his issues, but you updated your answer and he's in good shape now! :)
Steven Parker
231,268 PointsIn random.js on line 1 you define "alertrandom" (with little "r") but on line 5 you call "alertRandom" (capital "R"). Then on line 2 there is a plus sign ("+") following the variable name where there should be an assignment operator ("="), and "Math" is spelled correctly one time but the next time it is "math" (little "m") instead.
Also, while not a syntax error, in index.html the script
tag is inside a div
element, but normally it would be the last thing in the body
.
Rwanda Muhammad
Full Stack JavaScript Techdegree Student 4,116 PointsI know, i see my mistakes , OMG!!! the casing!!! Thanks much
Rwanda Muhammad
Full Stack JavaScript Techdegree Student 4,116 PointsIm a girl lol , yes im good thanks
Rwanda Muhammad
Full Stack JavaScript Techdegree Student 4,116 PointsRwanda Muhammad
Full Stack JavaScript Techdegree Student 4,116 PointsThanks for the quick response! I did change the + to an = still not working. https://w.trhou.se/x4uytc1d5u