Array Methods in

1. values()

2. length()

3. reverse()

4. sort()

5. at()

6. fill()

7. form()

8. join()

9. toString()

10. pop()

11. forEach()

12. shift()

13. copyWithin()

15. unShift()

16. concat()

18. splice()

20. lastIndexOf()

21. of()

25. findIndex()

17. some()

19. flat()

22. every()

23. slice()

24. flatmap()

26. find()

27. includes()

28. entries()

29. reduceRight()

30. reduce()

31. isArray()

32. filter()

14. push()

33. keys()

34. map()

Swipe It

Arrow

codderway.com

values():  This method returns an iterator that provides the values for each index in the array. It takes no arguments.

length(): This property returns the length of the array.

Swipe It

Arrow

codderway.com

reverse(): This method reverses the order of the elements in the array.

sort(): This method sorts the elements of an array in place and returns the sorted array. It can take an optional compare function as an argument.

Swipe It

Arrow

codderway.com

at(): This method returns the element at the specified index in the array. It takes one argument: the index.

fill(): This method fills all the elements of an array from a start index to an end index with a static value. It can take up to three arguments: the value to fill with, the start index, and the end index.

codderway.com

from(): This method creates a new array from an array-like object or an iterable object. It can take up to two arguments: the object to convert to an array, and a mapping function to apply to each element of the new array.

join(): This method joins all the elements of an array into a string using a specified separator. It takes one optional argument: the separator to use.

codderway.com

toString(): This method returns a string representing the array and its elements.

pop(): This method removes the last element from an array and returns that element.

Swipe It

Arrow

codderway.com

forEach(): method executes a provided function once for each array element. It doesn't return anything, it just executes the callback function on each element of the array.

shift(): method removes the first element from an array and returns that removed element. This method changes the length of the array.

Swipe It

Arrow

codderway.com

copyWithin(): method shallow copies part of an array to another location in the same array and returns the modified array without modifying its length.Syntax.copyWithin(target, start, end)

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

Swipe It

Arrow

codderway.com

unshift(): method adds one or more elements to the beginning of an array and returns the new length of the array.

concat(): method is used to merge two or more arrays. This method does not change the existing arrays, but instead returns a new array.

Swipe It

Arrow

codderway.com

splice(): method changes the contents of an array by removing or replacing existing elements and/or adding new elements in place.

flat() This method creates a new array with all sub-array elements concatenated into it recursively up to the specified depth.

Swipe It

Arrow

codderway.com

lastIndexOf(): This method returns the last index at which a given element can be found in the array.

indexOf(): This method returns the index of the first occurrence of a specified element in an array. If the element is not present, it returns -1.

Swipe It

Arrow

codderway.com

of(): This method creates a new array instance with a variable number of arguments, regardless of number or type of the arguments.

every(): This method checks if all elements in an array pass a test (provided as a function). It returns true if all elements pass the test; otherwise, it returns false.

Swipe It

Arrow

codderway.com

slice(): This method returns a shallow copy of a portion of an array into a new array object selected from begin to end (end not included).

flatMap(): This method maps each element using a mapping function, then flattens the result into a new array.

Swipe It

Arrow

codderway.com

findIndex(): This method returns the index of the first element in an array that passes a test (provided as a function). If no element passes the test, it returns -1.

find(): This method returns the value of the first element in an array that passes a test (provided as a function). If no element passes the test, it returns undefined.

Swipe It

Arrow

codderway.com

includes(): This method determines whether an array includes a certain value among its entries, returning true or false as appropriate.

entries(): This method returns a new Array Iterator object that contains the key/value pairs for each index in the array.

Swipe It

Arrow

codderway.com

reduce(): This method applies a function to each element of an array and reduces the array to a single value.

reduceRight(): This method is similar to the reduce() method. However, it iterates over the array elements from right to left instead of from left to right.

Swipe It

Arrow

codderway.com

isArray(): This method determines whether the passed value is an array or not.

filter(): This method creates a new array with all elements that pass the test implemented by the provided function.

Swipe It

Arrow

codderway.com

keys(): This method returns an array containing the keys of the given object.

map(): This method creates a new array with the results of calling a provided function on every element in the calling array.

Swipe It

Arrow

Did you find it

Useful ?

LEAVE A COMMENT !

Like

Share

Repost