I have an array of 800 objects.
cells = [
{ x_position: 0, y_position: 0, terrain: 'water' },
{ x_position: 0, y_position: 1, terrain: 'water' },
{ x_position: 0, y_position: 2, terrain: 'water' },
{ x_position: 0, y_position: 3, terrain: 'water' },
{ x_position: 0, y_position: 4, terrain: 'water' },
...
]
Let's say for some x_position and y_position I want to change the terrain to 'land'.
How can I iterate through the array changing the terrain?