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 trialAlessandra Vaughn
13,915 PointsCode Challenge Issue: Trying to use unshift on an array and it doesn't like it.
I'm on the "Adding Items to an Array" of the "Tracking Multiple Items with Arrays" and I think there is a bug. Or I am missing something?
Instructions: Now, add 3 names to the beginning of the list using the other array method you learned in the last video
My code:
var guestList = ['Sandra', 'Omar', 'Magnus', 'Becky'];
guestList.push('Jacob', 'Lily');
guestList.unshift('Jake', 'Paula', 'Rick');
And the response from the program is this: Bummer! Looks like you're passing at least one empty string. Come on, give us 3 real names!
6 Answers
Treasure Porth
Treehouse TeacherYeah, I think it's a bug. Your code worked fine for me in the command line, but Treehouse gave me the same error.
Dave McFarland
Treehouse TeacherYes, this is a bug. I'm sorry for the frustration. 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
If you find another error like this in the course feel free to contact me directly via e-mail: dave@teamtreehouse.com.
Alessandra Vaughn
13,915 PointsThank you for fixing it so quickly. I really wanted my badge. :)
Dave McFarland
Treehouse TeacherYou're welcome Alessandra Vaughn
Sorry it was broken!
Kenoye Naku
1,641 PointsIm also having this issue, my code isnt working it says task one is not being pushed.
Dave McFarland
Treehouse TeacherHello Kenoye Naku Can you show us the code you are typing into the code challenge?
Edward Smith
Courses Plus Student 4,230 Pointsvar guestList = ['Sandra', 'Omar', 'Magnus', 'Becky']; guestList.unshift('Bill', 'Ted', 'nilll');
Doesn't pass, but definitely should...
Ben Os
20,008 PointsSame bug here.
Dave McFarland
Treehouse TeacherI've updated the quiz so that the instructions are more clear: https://teamtreehouse.com/library/javascript-loops-arrays-and-objects/tracking-multiple-items-with-arrays/adding-items-to-an-array
cc/ Ben Aharoni