function compact (arr) {
  return arr.filter(function (val) {
    if (!val) return false
    if (val.length !== undefined) return val.length !== 0
    for (var key in val) if (has.call(val, key)) return true
    return false
  })
}
Compact an array,
removing empty objects

@param {Array} arr
@return {Array}