It might be easier to read with something like this:

```js
ol.Feature.prototype.getAttributes = function(opt_nonGeometry) {
  var keys = this.getKeys(),
      includeGeometry = !opt_nonGeometry,
      len = keys.length,
      attributes = {},
      i, key;
  for (i = 0; i < len; ++ i) {
    key = keys[i];
    var value = this.get(key);
    if (includeGeometry || !(value instanceof ol.geom.Geometry)) {
      attributes[key] = value;
    }
  }
  return attributes;
};