- Functions 4
concat ( valueN: Array ) →{ Array }
The concat() method is used to merge two or more arrays. This method does not change the existing arrays, but instead returns a new array.
Parameters
Name | Type | Description |
---|---|---|
valueN | Array | Arrays and/or values to concatenate into a new array. If all valueN parameters are omitted, concat returns a shallow copy of the existing array on which it is called. See the description below for more details. |
Returns
A new Array instance.
copyWithin ( target: Array , start: Number , end: Number ) →{ Array }
The copyWithin() method shallow copies part of an array to another location in the same array and returns it without modifying its length.
Parameters
Name | Type | Description |
---|---|---|
target | Array | Zero-based index at which to copy the sequence to. If negative, target will be counted from the end. |
start | Number | Zero-based index at which to start copying elements from. If negative, start will be counted from the end. |
end | Number | Zero-based index at which to end copying elements from. copyWithin copies up to but not including end. If negative, end will be counted from the end. |
Returns
The modified array.
entries ( ) →{ Object }
The entries() method returns a new Array Iterator object that contains the key/value pairs for each index in the array.
Returns
A new Array iterator object.
every ( callback: Object , thisArg: Object ) →{ Boolean }
The every() method tests whether all elements in the array pass the test implemented by the provided function. It returns a Boolean value.
Parameters
Name | Type | Description |
---|---|---|
callback | Object | A function to test for each element, taking three arguments: element, index, array |
thisArg | Object | A value to use as this when executing callback |
Returns
true if the callback function returns a truthy value for every array element. Otherwise, false.