@stdlib/symbol-is-concat-spreadable
v0.1.1
Published
Concat spreadable symbol.
Readme
IsConcatSpreadableSymbol
Concat spreadable symbol which specifies whether an array-like object should be flattened to its array elements during concatenation.
Installation
npm install @stdlib/symbol-is-concat-spreadableUsage
var IsConcatSpreadableSymbol = require( '@stdlib/symbol-is-concat-spreadable' );IsConcatSpreadableSymbol
Concat spreadable symbol which specifies whether an array-like object should be flattened to its array elements during concatenation.
var s = typeof IsConcatSpreadableSymbol;
// e.g., returns 'symbol'Notes
- The symbol is only supported in environments which support symbols. In non-supporting environments, the value is
null.
Examples
var IsConcatSpreadableSymbol = require( '@stdlib/symbol-is-concat-spreadable' );
var x = [ 1, 2, 3 ];
var y = {
'length': 3,
'0': 4,
'1': 5,
'2': 6
};
y[ IsConcatSpreadableSymbol ] = true;
console.log( x.concat( y ) );
y[ IsConcatSpreadableSymbol ] = false;
console.log( x.concat( y ) );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
License
See LICENSE.
Copyright
Copyright © 2016-2026. The Stdlib Authors.
