Home Manual Reference Source

Overview

Installation

Can be managed using jspm or npm.

jspm

jspm install npm:@array-like/experimental

npm

npm install @array-like/experimental --save

Usage

The code needs a ES2015+ polyfill to work, for example regenerator-runtime/runtime.

await import( 'regenerator-runtime/runtime.js' ) ;
// or
import 'regenerator-runtime/runtime.js' ;

Then

const array = await import( '@array-like/experimental' ) ;
// or
import array from '@array-like/experimental' ;

Examples

let A = array.alloc( 10000 ) ;

array.iota( A , 0 , 10000 , 1 ) ;

let B = array.alloc( 20000 ) ;

array.copy( A , 0 , 10000 , B ,     0 ) ;
array.copy( A , 0 , 10000 , B , 10000 ) ;

B ; // [ 0 , 1 , ... , 9999 , 0 , 1 , ... , 9999 ]