code: function concatArrayFields(properties, fields){
    let arr = [];
    fields.forEach(field => {
      if (Array.isArray(properties[field]) && properties[field].length) {
        arr = arr.concat(properties[field]);
      }
    });
    // dedupe array
    return arr.filter((item, pos, self) => self.indexOf(item) === pos);
  }
docs: convenience function to safely concat array fields