Skip to content

Commit efd320c

Browse files
array notes
1 parent 293628a commit efd320c

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

Arrays/array.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
123
JavaScript array methods can be categorized into two groups:
224
- Mutating methods: These are the methods that directly modify the original array.
325
- Non-mutating methods: These methods return a new array without altering the

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Welcome to your comprehensive JavaScript interview notes! This repository contai
3636
---
3737

3838
## 📖 Index
39+
- [Arrays](Arrays/array.md)
3940
- [Functions](functions/functions.md)
4041
- [Closures](Closures/README.md)
4142
- [Event Loop](JS%20Interview%20Questions/eventloop.md)

index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
## 📚 Table of Contents
5+
- [Arrays](Arrays/array.md)
56
- [Functions](functions/functions.md)
67
- [Closures](Closures/closures.md)
78
- [Event Loop](JS-Interview-Questions/eventloop.md)

0 commit comments

Comments
 (0)