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 Arrays Loop Through Arrays Useful Array Methods

GOT AN ARRAY METHOD THAT WORKS IN CONSOLE BUT THE QUIZ WILL NOT ACCEPT IT

Trying again on my own but failing and out of time; I must move on.

JAVASCRIPT ARRAY METHODS QUIZ I have the following code from the Array Methods Quiz

const planets = ['Earth','Mars','Saturn','Mecury','Jupiter','Venus','Uranus','Neptune']; let items; let booger; items = planets.join(', '); booger = ( planets[planets.length - 1] ) console.log( booger );

Booger converts the selection so the string Neptune prints when placed in the console.log.

ERROR MESSAGE Reads: "Are you logging the final string to the console?"

I have refreshed the quiz twice.

I cannot figure out what I would be doing incorrectly when I get this code to fire up flawlessly on my desktop.

1 Answer

Steven Parker
Steven Parker
229,644 Points

By "final string", they mean the string you create using "join", not just the final array item.

Try logging "items" instead.

Thank you again Mr. Parker for your expeditious reply. This site should be renamed "ParkerHouse".

My low acuity read in to the question "the last string within the array".

Less confusing ways to ask the question, at least for me, would have been: "The string just created" or "The resultant output from the join method" would have kept me on track.

Steven Parker
Steven Parker
229,644 Points

See the Support page for how to submit suggestions.
I've seen more than one question that could benefit from a little rephrasing.