JSPM

@stdlib/array-base-copy

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 181
  • Score
    100M100P100Q82271F
  • License Apache-2.0

Copy the elements of an array-like object to a new generic array.

Package Exports

  • @stdlib/array-base-copy
  • @stdlib/array-base-copy/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@stdlib/array-base-copy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

copy

NPM version Build Status Coverage Status

Copy the elements of an array-like object to a new "generic" array.

Installation

npm install @stdlib/array-base-copy

Usage

var copy = require( '@stdlib/array-base-copy' );

copy( x )

Copies the elements of an array-like object to a new "generic" array.

var x = [ 1, 2, 3 ];

var out = copy( x );
// returns [ 1, 2, 3  ]

var bool = ( out === x );
// returns false

Examples

var Complex64Array = require( '@stdlib/array-complex64' );
var realf = require( '@stdlib/complex-realf' );
var imagf = require( '@stdlib/complex-imagf' );
var copy = require( '@stdlib/array-base-copy' );

// Create a complex number array:
var arr = new Complex64Array( 10 );

// Copy elements to a generic array:
var out = copy( arr );

// Retrieve the first element:
var z = out[ 0 ];
// returns <Complex64>

var re = realf( z );
// returns 0.0

var im = imagf( z );
// returns 0.0

console.log( '%d + %di', re, im );
// => '0 + 0i'

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright © 2016-2022. The Stdlib Authors.