time-to-botec

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

repl.txt (1405B)


      1 
      2 {{alias}}( collection1, collection2 )
      3     Adds the elements of one collection to the beginning of another collection.
      4 
      5     If the input collection is a typed array, the output value does not equal
      6     the input reference and the underlying `ArrayBuffer` may *not* be the same
      7     as the `ArrayBuffer` belonging to the input view.
      8 
      9     For purposes of generality, always treat the output collection as distinct
     10     from the input collection.
     11 
     12     Parameters
     13     ----------
     14     collection1: Array|TypedArray|Object
     15         A collection. If the collection is an `Object`, the collection should be
     16         array-like.
     17 
     18     collection2: Array|TypedArray|Object
     19         A collection containing the elements to add. If the collection is an
     20         `Object`, the collection should be array-like.
     21 
     22     Returns
     23     -------
     24     out: Array|TypedArray|Object
     25         Updated collection.
     26 
     27     Examples
     28     --------
     29     // Arrays:
     30     > var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];
     31     > arr = {{alias}}( arr, [ 6.0, 7.0 ] )
     32     [ 6.0, 7.0, 1.0, 2.0, 3.0, 4.0, 5.0 ]
     33 
     34     // Typed arrays:
     35     > arr = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0 ] );
     36     > arr = {{alias}}( arr, [ 3.0, 4.0 ] )
     37     <Float64Array>[ 3.0, 4.0, 1.0, 2.0 ]
     38 
     39     // Array-like object:
     40     > arr = { 'length': 1, '0': 1.0 };
     41     > arr = {{alias}}( arr, [ 2.0, 3.0 ] )
     42     { 'length': 3, '0': 2.0, '1': 3.0, '2': 1.0 }
     43 
     44     See Also
     45     --------
     46