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 Adding Items to an Array

Lewis Cowles
Lewis Cowles
74,902 Points

Broken test

Yeah so I was using unshift, it does work, it does add 3 names and no one of them is not blank (which is such a stupid error, I cannot begin to think how the test is failing)

Tested in JsFiddle with addition of adding to DOM via document.body.innerHTML appending.... http://jsfiddle.net/qppjdju7/

script.js
var guestList = ['Sandra', 'Omar', 'Magnus', 'Becky'];
guestList.push('armand','luca');
guestList.unshift('Jim','Amelia','Kurt');
index.html
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JavaScript Loops</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
Chris Shaw
Chris Shaw
26,676 Points

Tagging Dave McFarland so he can investigate this.

2 Answers

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

I'm terribly sorry about the error Lewis Cowles

I'ved fixed the problem and the code challenge should now work: https://teamtreehouse.com/library/javascript-loops-arrays-and-objects/tracking-multiple-items-with-arrays/adding-items-to-an-array

Thanks for bringing this error to our attention. If you find another error like this in the course feel free to contact me directly via e-mail: dave@teamtreehouse.com.

cc/ Chris Upjohn Raymond Wach

Lewis Cowles
Lewis Cowles
74,902 Points

:smile: NP Dave McFarland, TBH I just wanted the points, and to know I could send a junior off to polish his JS ;) Have a great Friday and weekend!

Raymond Wach
Raymond Wach
7,961 Points

There have been a couple other questions about this challenge that agree the test is broken.

Lewis Cowles
Lewis Cowles
74,902 Points

Thanks for that, the problem is they did not show up when I was writing the question, so what exactly was this meant to add?

Oh just FYI, after completing the rest of the course I went to the forums to check

https://teamtreehouse.com/forum/topic:javascript/code-challenge:5762

NOTHING!!!! SO NEXT TIME IF YOUR NOT GOING TO HELP PLEASE DON'T ANSWER OR COMMENT