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 trialRichard Preske
Courses Plus Student 4,356 Pointsdrop token not working
targetColumn not iterable in playToken() method. This causes the drop token not to work.
1 Answer
Steven Parker
231,236 PointsThe "spaces" array currently has only one column The code that creates the column in Board.js at line 9 should be inside the loop instead of before it. Oddly, there's a commented-out statement in the right location at line 11!
And the code that adds the column to the main array at line 18 should also be inside the loop instead of after it.
Richard Preske
Courses Plus Student 4,356 PointsRichard Preske
Courses Plus Student 4,356 PointsLine 41 is where the issue lies. Are we looking at the same code here? line 9 in Game.js is const players. I don't see no commented out statement either on line 11.
Steven Parker
231,236 PointsSteven Parker
231,236 PointsThe error occurs later in Game.js when you move to a column that has not been set up.
But the problem is where the board is created in Board.js.