0% found this document useful (0 votes)
105 views

Array Functions in Typescript

This document lists and describes 22 array functions in TypeScript including concat(), every(), filter(), find(), findIndex(), forEach(), includes(), indexOf(), join(), lastIndexOf(), map(), pop(), push(), reduce(), reduceRight(), reverse(), shift(), slice(), some(), sort(), splice(), toString(), and unshift(). These array functions can make working with arrays in TypeScript more efficient.

Uploaded by

Hafsa Tufail
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views

Array Functions in Typescript

This document lists and describes 22 array functions in TypeScript including concat(), every(), filter(), find(), findIndex(), forEach(), includes(), indexOf(), join(), lastIndexOf(), map(), pop(), push(), reduce(), reduceRight(), reverse(), shift(), slice(), some(), sort(), splice(), toString(), and unshift(). These array functions can make working with arrays in TypeScript more efficient.

Uploaded by

Hafsa Tufail
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

List of all array functions in Typescript : 

 concat(): Returns a new array that contains the elements from the
original array followed by the elements from one or more specified
arrays. 

 every(): Returns a Boolean value that indicates whether all the


elements in the array pass a specified test. 

 filter(): Returns a new array that contains all the elements from the
original array that pass a specified test. 

 find(): Returns the value of the first element in the array that satisfies
the provided testing function. 

 findIndex(): Returns the index of the first element in the array that
satisfies the provided testing function. 

 forEach(): Calls a function for each element in the array. 

 includes(): Determines whether an array includes a certain element,


returning a Boolean value. 

 indexOf(): Returns the index of the first occurrence of a specified


element in the array. 

 join(): Joins all elements of an array into a string. 

 lastIndexOf(): Returns the index of the last occurrence of a specified


element in the array. 

 map(): Returns a new array that contains the results of calling a


function on each element in the array. 

 pop(): Removes the last element from an array and returns that
element.

 push(): Adds one or more elements to the end of an array and returns
the new length of the array. 

 reduce(): Applies a function to each element in the array to reduce it


to a single value. 
 reduceRight(): Applies a function to each element in the array (from
right to left) to reduce it to a single value.

 reverse(): Reverses the order of the elements in an array. 

 shift(): Removes the first element from an array and returns that
element. 

 slice(): Returns a portion of an array into a new array. 

 some(): Returns a Boolean value that indicates whether at least one


element in the array passes a specified test. 

 sort(): Sorts the elements of an array. 

 splice(): Adds or removes elements from an array. 

 toString(): Converts an array to a string. 

 unshift(): Adds one or more elements to the beginning of an array


and returns the new length of the array. 

These array functions can make working with arrays in TypeScript much
easier and more efficient. 

You might also like