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!
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
Brian ProutyFront End Web Development Techdegree Student 10,143 Points
.push() wont grab correct variable
For whatever reason I cannot get my program to pick up the question variable for this code challenge. I changed the .push method to say
to get the code to work how I want it to for the challenge, but in the solution video it says to just write it how it is shown below... But when I do that it just prints the letter H for everything.
My code is as shown below:
Clayton PerszykTreehouse Moderator 48,709 Points
In printList you are using list[i] and that is grabbing the first letter. Use list[i] to grab the whole sentence.