Replace `for` with `forEach`