You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Arrays/array.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,25 @@
1
+
Arrays are one of the most fundamental data structures in JavaScript. They are used to store collections of values, and provide a variety of methods for manipulating and working with those values.
2
+
3
+
declaring an array:
4
+
```javascript
5
+
let arr = [1, 2, 3];
6
+
```
7
+
8
+
accessing an array:
9
+
```javascript
10
+
let arr = [1, 2, 3];
11
+
console.log(arr[0]); // 1
12
+
```
13
+
14
+
modifying an array:
15
+
```javascript
16
+
let arr = [1, 2, 3];
17
+
arr[0] =4;
18
+
console.log(arr); // [4, 2, 3]
19
+
```
20
+
21
+
----------------------
22
+
1
23
JavaScript array methods can be categorized into two groups:
2
24
- Mutating methods: These are the methods that directly modify the original array.
3
25
- Non-mutating methods: These methods return a new array without altering the
0 commit comments