Array<T>.prototype.*
concat(...items: (T | Array<T>)[]): T[]🔒- Returns a new array that is the concatenation of
thisand allitems. Non-array parameters are treated as if they were arrays with single elements. - ES3
['a'].concat('b', ['c', 'd']) → [ 'a', 'b', 'c', 'd' ]
- Returns a new array that is the concatenation of
copyWithin(target: number, start: number, end?: number): this✏️- Copies the elements whose indices range from
startto (excl.)endto indices starting withtarget. Overlapping is handled correctly. - ES6
['a', 'b', 'c', 'd'].copyWithin(0, 2, 4) → [ 'c', 'd', 'c', 'd' ]
- Copies the elements whose indices range from
entries(): Iterable<[number, T]>🔒- Returns an iterable over [index, element] pairs.
- ES6
Array.from(['a', 'b'].entries()) → [ [ 0, 'a' ], [ 1, 'b' ] ]
every(callback: (value: T, index: number, array: Array<T>) => boolean, thisArg?: any): boolean🔒- Returns
trueifcallbackreturnstruefor every element. Stops as soon as it receivesfalse. Math: ∀ - ES5
[1, 2, 3].every(x => x > 0) → true[1, -2, 3].every(x => x > 0) → false
- Returns
fill(value: T, start?: number, end?: number): this✏️- Assigns
valueto every index. - ES6
[0, 1, 2].fill('a') → [ 'a', 'a', 'a' ]
- Assigns
filter(callback: (value: T, index: number, array: Array<T>) => any, thisArg?: any): T[]🔒- Returns an array with only those elements for which
callbackreturnstrue. - ES5
[1, -2, 3].filter(x => x > 0) → [ 1, 3 ]
- Returns an array with only those elements for which
find(predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): T | undefined🔒- The result is the first element for which
predicatereturnstrue. If it never does, the result isundefined. - ES6
[1, -2, 3].find(x => x < 0) → -2[1, 2, 3].find(x => x < 0) → undefined
- The result is the first element for which
findIndex(predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): number🔒- The result is the index of the first element for which
predicatereturnstrue. If it never does, the result is-1. - ES6
[1, -2, 3].findIndex(x => x < 0) → 1[1, 2, 3].findIndex(x => x < 0) → -1
- The result is the index of the first element for which
forEach(callback: (value: T, index: number, array: Array<T>) => void, thisArg?: any): void🔒- Calls
callbackfor each element. - ES5
['a', 'b'].forEach((x, i) => console.log(x, i))
- Calls
includes(searchElement: T, fromIndex?: number): boolean🔒- Returns
trueifsearchElementis an element andfalse, otherwise. - ES2016
[0, 1, 2].includes(1) → true[0, 1, 2].includes(5) → false
- Returns
indexOf(searchElement: T, fromIndex?: number): number🔒- Return the index of the first element that is strictly equal to
searchElement. Return-1if there is no such element. Start searching at indexfromIndex. - ES5
[0, 1, 2].indexOf(1) → 1[0, 1, 2].indexOf(5) → -1
- Return the index of the first element that is strictly equal to
joinkeyslastIndexOfmappoppushreducereduceRightreverseshiftslicesomesortsplicetoLocaleStringtoStringunshiftvalues
How holes are handled is described in Sect. “Array operations and holes” in “Exploring ES6”.
Please, can I join you in this quest? I will do my research well on these API's and start contributing.