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 trial3 Answers
Steven Parker
231,275 PointsThere's still a few more issues to be addressed:
- the loop only asks the questions, the scoring code is outside the loop
- since the answers are all numbers, the "guess" must be converted to match
- the index for the answer should be "
[i][1]
", not "[0][i]
" - questionsCorrect should be assigned with the concatenating operator ("+=")
- both "questionsCorrect" and "wrong" should be initialzed to an empty string
Steven Parker
231,275 PointsAt first glance, I notice two things in "quiz.js:
- on line 23 you call "propt", but you don't store the value it returns anywhere
- on line 24 you attempt to convert the questions array into a number
I'd guess that a new variable (first to store, then convert from) should be involved in both lines.
angelod
6,694 Pointsfix some errors, but don't understand what you mean by storing the value so it returns anywhere. not quite sure on how to do that. well just confuse
Steven Parker
231,275 PointsYou might use an assignment to save the result of using "propt", as in this generic example:
var someVariable = prompt("a prompt question");
Calling "prompt" without the assignment asks the question, but whatever answer the user types is lost.
angelod
6,694 Pointshttps://w.trhou.se/sow65d22v6 fix it but still same out come https://gyazo.com/94ff4efbf5587acb8a93d09c5526a342