refactored for loop so it can support destructuring assignments
changed dynamic key property from [key] back to (key) to avoid confusion with destructuring assignment syntax