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 trialJacob Tennyson
6,240 PointsError in JS
Uncaught ReferenceError: Invalid left-hand side expression in postfix operation
//cycle ove rincompleteTaskHolder ul list items
for(var index = 0; index < incompleteTasksHolder.children.length; 1++)
{
//bind events to list items children (taskCompleted)
bindTaskEvents(incompleteTasksHolder.children[i], taskCompleted);
}
Suggestions?
Sally Gradle
24,694 PointsRoberto has got it. Try i++ instead of 1++.
1 Answer
Chad Dugas
Courses Plus Student 13,304 PointsYou also cant use .children[i] if you are going to call your variable index. You have to put .children[index].
Roberto Alicata
Courses Plus Student 39,959 PointsRoberto Alicata
Courses Plus Student 39,959 Pointsyou wrote 1++ in the FOR loop instead of index++ and you used the variable i inside the loop but you must use index