src/components/extractFields.js
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);
}
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);
}
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 ) ; }
convenience function to safely concat array fields
convenience function to safely concat array fields