Skip to content

Commit a1570db

Browse files
committed
Update js-array-methods.md
1 parent f98ec1c commit a1570db

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

JavaScript/Array methods/js-array-methods.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Array methods cheatsheet
22

3+
---
4+
35
## Adding/Removing elements
46

57
- **push**(...items) <br>
@@ -66,6 +68,8 @@ const newArr = arr.slice(1, 4);
6668
// newArr = [2, 3, 4]
6769
```
6870

71+
---
72+
6973
## Search among elements
7074

7175
- **indexOf / lastIndexOf**(item, pos) <br>
@@ -106,6 +110,8 @@ const evenArr = arr.filter((item) => {
106110
}); // evenArr = [2, 4, 6]
107111
```
108112

113+
---
114+
109115
## Iteration of elements
110116

111117
- **forEach**(func(item, index, array)) <br>
@@ -121,6 +127,8 @@ arr.forEach((item, index, arr) => {
121127
// 3 2 [1, 2, 3]
122128
```
123129

130+
---
131+
124132
## Transform the array
125133

126134
- **map**(func(item, index, array)) <br>

0 commit comments

Comments
 (0)