Skip to content

Function_evisit_core_js_data_extract

Wyatt Greenway edited this page Jan 31, 2017 · 3 revisions

function extract(key[, args...])

Parameters

  • key
    • (String) Key to extract from all objects
  • args... [optional]
    • (Object) >>> Array(s) to extract from

Return value

  • (Object) Array of extracted properties. If the property wasn't found the array element will be 'undefined'.

Description

Extracts elements from an Array of Objects (not parts from a String). This is not the same as

See Also

Examples

var myParts = extract('id', [
{
  id:'derp',
  field: 'derp'
},
{
  id:'dog',
  field: 'dog'
},
{
  id:'cat',
  field: 'cat'
}
], [
{
  id:'another',
  field: 'another'
},
{
  id:'field',
  field: 'field'
}
]);
myParts === ['derp','dog','cat','another','field'];

Clone this wiki locally