<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Write a script in JavaScript to iterate over a given array of objects and return all objects with the color green.
const arr = [{ color: 'blue', shape: 'square' }, { color: 'red', shape: 'triangle' }, { color: 'green', shape: 'circle' }]<|im_end|>
<|im_start|>assistant
const greenObjects = arr.filter(obj => obj.color === 'green');<|im_end|>
