*Array Iteration Methods can be classified into following types
1.Array forEach
- forEach () calls a function once for each array element. (e.g)

OUTPUT:
0
1
2
3
4
Here Callback function runs 5 times(for each value function runs)to execute code.
2.Array map()
- Map() creates new array by callback function without replacing original array it clones the array
- Map() returns value (e.g)
3.Array flat map()
- flat map() is used to expanding elements ,maps all elements of array and creates new array (e.g)

OUTPUT:[1,10,2,20,3,30,4,40,5,50]
4.Array filter()
- filter() used to create new array by passing test by condition . (e.g)
5.Array reduce()
- reduce() used to produce single value by running each elements in array
- It runs from left to right. (e.g)
6.Array reduceRight()
- reduceRight() is also used to produce single value by running every elements in array
- Only difference is it runs from right to left
- Looks similar to reduce() (e.g)
7.Array every()
- every() checks if all array elements get pass
- If even single element get fail the result get false.
(e.g)
OUTPUT: False
8.Array some()
- Some() checks if some array value get pass
- If even a single element get pass result is true (e.g)
9.Array.from()
- Array.from() used to convert from string to array (e.g)
10.ArraySpread()
- spread() used to combine two different array (e.g)
*11. ArrayRest()
**Rest() is used to collect remaining elements of array into nee array
(e.g)
12.Arraywith()
- with() used to update elements in array without changing the original array. (e.g)

OUTPUT: [ 'Akash', 'mani', 'surya', 'sharma']
*13.Array keys() [Tbd]
14.Array entries() [Tbd]
*








Top comments (0)