Either:

```javascript
var attached = [];
attachements = /* ... */;
attachements.forEach(/*...*/);
```

or

```javascript
attachements = /* ... */;
var attached = [];

attachements.forEach(/* ... */);
```