time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

repl.txt (1136B)


      1 
      2 {{alias}}( arr, prop[, options] )
      3     Extracts a property value from each element of an object array.
      4 
      5     The function skips `null` and `undefined` array elements.
      6 
      7     Extracted values are not cloned.
      8 
      9     Parameters
     10     ----------
     11     arr: Array
     12         Source array.
     13 
     14     prop: string
     15         Property to access.
     16 
     17     options: Object (optional)
     18         Options.
     19 
     20     options.copy: boolean (optional)
     21         Boolean indicating whether to return a new data structure. To mutate the
     22         input data structure (e.g., when input values can be discarded or when
     23         optimizing memory usage), set the `copy` option to `false`. Default:
     24         true.
     25 
     26     Returns
     27     -------
     28     out: Array
     29         Destination array.
     30 
     31     Examples
     32     --------
     33     > var arr = [
     34     ...     { 'a': 1, 'b': 2 },
     35     ...     { 'a': 0.5, 'b': 3 }
     36     ... ];
     37     > var out = {{alias}}( arr, 'a' )
     38     [ 1, 0.5 ]
     39 
     40     > arr = [
     41     ...     { 'a': 1, 'b': 2 },
     42     ...     { 'a': 0.5, 'b': 3 }
     43     ... ];
     44     > out = {{alias}}( arr, 'a', { 'copy': false } )
     45     [ 1, 0.5 ]
     46     > var bool = ( arr[ 0 ] === out[ 0 ] )
     47     true
     48 
     49     See Also
     50     --------
     51