Use `Array.map` here:

```javascript
return cues.map(function(cue) {
  var div = ...
  div.style = ...
  return div;
});
```