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

JavaScript JavaScript Loops, Arrays and Objects Tracking Multiple Items with Arrays Build a Quiz Challenge, Part 2 Solution

Cannot get the "correct" and "wrong" ordered lists to print to the page.

I thought I had copied the code exactly as presented, but cannot find the error.

Here is the snapshot of my workspace: https://w.trhou.se/t8jopoobhp

Never mind. I figured it out. Apparently I am dyslexic. I spelled length as "lenght".

Aaron Martone
Aaron Martone
3,290 Points

I'd be interested in knowing how you're using print() with a variable.

Not only that, but are you looking at your console log while outputting? If the .length property was not spelled correctly, you would get a pretty indicative error indicating that there was no such property defined.

1 Answer

Aaron Martone
Aaron Martone
3,290 Points

print() is a function of the window object that calls up the Print Dialogue (to print your page output) You pass html into print() but print() does not accept arguments. It simply prints the contents of your page. You can perform a document.write(html) instead, though doing so at that point will erase your generated HTML so far.