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 trialcarlosdiaz11
1,810 Pointsif the FOR - IN loop implicitly uses a constant, could it be used in anyway to modify the value of each element?
//Pseudo-code for item in Array { if item meets certain criteria then modify it }
1 Answer
Ravee Sundar
Courses Plus Student 1,975 PointsIf the Array is Mutable, you can check a condition and modify it by using the following
[myMutableArray replaceObjectAtIndex:index withObject:newObject];
Please refer the following URL for more details: