TypeScript – Array toString()
toString() method returns a string representing the source code of the specified array and its elements. Syntax array.toString(); Parameter Details − Return Value Returns a string representing the array. Example…
toString() method returns a string representing the source code of the specified array and its elements. Syntax array.toString(); Parameter Details − Return Value Returns a string representing the array. Example…
splice() method changes the content of an array, adding new elements while removing old elements. Syntax array.splice(index, howMany, [element1][, ..., elementN]); Parameter Details index − Index at which to start changing…
sort() method sorts the elements of an array. Syntax array.sort( compareFunction ); Parameter Details compareFunction − Specifies a function that defines the sort order. If omitted, the array is sorted lexicographically.…
some() method tests whether some element in the array passes the test implemented by the provided function. Syntax array.some(callback[, thisObject]); Parameter Details callback − Function to test for each element.thisObject − Object…
slice() method extracts a section of an array and returns a new array. Syntax array.slice( begin [,end] ); Parameter Details begin − Zero-based index at which to begin extraction. As a…
shift()method removes the first element from an array and returns that element. Syntax array.shift(); Return Value Returns the removed single value of the array. Example var arr = [10, 1,…
reverse() method reverses the element of an array. The first array element becomes the last and the last becomes the first. Syntax array.reverse(); Return Value Returns the reversed single value…
reduceRight() method applies a function simultaneously against two values of the array (from right-to-left) as to reduce it to a single value Syntax array.reduceRight(callback[, initialValue]); Parameter Details callback − Function to…
reduce() method applies a function simultaneously against two values of the array (from left-to-right) as to reduce it to a single value. Syntax array.reduce(callback[, initialValue]); Parameter Details callback − Function to…
push() method appends the given element(s) in the last of the array and returns the length of the new array. Syntax array.push(element1, ..., elementN); Parameter Details element1, ..., elementN − The…