# Arrays Cheatsheet

### **Array.map()**
Returns a new array with the results of calling a function for every element.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661603876083/oeepSXORw.png align="left")

### **Array.filter()**
Returns a new array with all elements that passed the requirement of the provided function.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661604562634/mOZ3lGEIK.png align="left")

### **Array.reduce()**
Reduce the array to a single value. which are all the elements added together.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661604861778/-2NnWa219.png align="left")


### **Array.fill()**
fill the elements in the array with the element that is defined.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661605152695/n3FN_HUQ9.png align="left")

### **Array.find()**
Returns the value of the first element in the array that satisfies the provided testing function. Otherwise undefined is returned.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661605292095/7VzMBOdYm.png align="left")

### **Array.indexOf()**
Returns the first index at which a given element can be found in the array, or -1 if it is not present.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661605529814/YmO2Ke6pox.png align="left")

### **Array.includes()**
Returns true if the given element is present in the array.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661605612984/yzGYJEqV-.png align="left")

### **Array.pop()**
Removes the last element from an array and returns that element.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661605694372/poUDMfQNb.png align="left")

### **Array.push()**
Appends new elements to the end of an array, and returns the new length.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661605782523/kvIrorefP.png align="left")

### **Array.shift()**
Removes the first element from an array and returns that element.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661605861687/XUAI-PIai.png align="left")

### **Array.unshift()**
Adds new elements to the beginning of an array, and returns the new length.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661605941750/yr7-te1ck.png align="left")

### **Array.splice()**
Changes the contents of an array by removing or replacing existing elements and/or adding new elements in place.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661606036159/aPPQ4XZPj.png align="left")

### **Array.slice()**
Returns a shallow copy of a portion of an array into a new array object selected from beginning to end. The original array will not be modified.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661606121069/kNoAhUk5w.png align="left")

### **Array.join()**
Joins all elements of an array into a string.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661606203975/ZEc5zjAtk.png align="left")

### **Array.reverse()**
Reverses the order of the elements in an array.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661606222158/n5USnzdkz.png align="left")

### **Array.sort()**
Sorts the elements of an array in place and returns the array ( doesn't work the same for numbers).
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661606736480/RdM6ZVQ7V.png align="left")

### **Array.some()**
Returns true if at least one element in the array passes the test implemented by the provided function.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661606819253/iyeNZBJ6m.png align="left")

### **Array.of()**
Creates a new array with a variable number of arguments, regardless of the number or type of the arguments.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661606880224/_vkU1eJsg.png align="left")

### **Array.isArray()**
Returns true if the given value is an array.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661606917659/Ofn8PrzWO.png align="left")

### **Array.at()**
Returns a value at the specified index.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661606961669/f3RJ858T6.png align="left")

### **Array.copyWithin()**
Copies array elements within the array. Returns the modified array.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661607017555/CIN38XHjF.png align="left")

### **Array.flat()**
Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth.
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1661607055857/MUzfsBpBV.png align="left")


                                            Hopefully, you enjoyed !

