1. Map loop
Let Arr=[1,2,3,4];arr.map (function (Value,key,arr) {//value, index, array (default = selected array) return item; Returns an array of all undefined if no return, number is index +1 (key+1)})//returns an array
2. Foreach Loop
Let Arr=[1,2,3,4];arr.map (function (Value,key,arr) {//value, index, array (default = selected array) return item; Do anything})//return only undefined
3. Filter loop
Let Arr=[1,2,3,4];arr.map (function (Value,key,arr) {//value, index, array (default = selected array) return false; Based on true and false to see if the original array is returned})//false return [],true returns only the original array
4. Reduce cycle (from beginning to end)
Let Arr=[1,2,3,4];arr.map (function (Fristvalue,nextvalue,key,arr) {//Array first value (first occurrence), next value of array, index, array (default is selected array) return fristvalue+nextvalue; Add all values, always iterate})//Return the result of the return iteration
5. Reduceright cycle (from tail to head)
Let Arr=[1,2,3,4];arr.map (function (Fristvalue,nextvalue,key,arr) {//array last value (first occurrence), array next value, index, array (default = selected array) return fristvalue+nextvalue; Add all values, always iterate})//Return the result of the return iteration
JavaScript's map loop, foreach Loop, filter loop