We can depend on ES5, so this could be written as 

```js
return Object.keys(data).map(function(key){
  return 'data-' + key + '="' + data[key] + '"';
}).join(' ');
```