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 trialrobertmills2
Courses Plus Student 14,965 PointsDeprecation and warning in the MDN
The MDN Warns to never use a foreach loop with an array only objects. Does anyone know more about this?
const numbers = [1, 2, 3, 4, 5];
let total = 0;
// Write loop here:
2 Answers
Paolo Scamardella
24,828 PointsI believe you are confused with for-each-in vs forEach. It is perfectly fine to use forEach, and the task is asking to use forEach. for-each-in is the one that is or will be deprecated.
Here is the link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/For-each-in_loops_are_deprecated
robertmills2
Courses Plus Student 14,965 PointsVery Cool. Cleared it right up. Thanks for jumping in there and helping. Cheers!!!