Skip to content

Commit 57d054e

Browse files
author
Wakidur Rahaman
committed
Deletion
1 parent cf8a4d8 commit 57d054e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/exercises/arrays/array-01.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,13 @@ const array_insertion: number[] = [1, 2, 3, 4];
66
array_insertion.push(5);
77
array_insertion.push(7);
88
array_insertion.push(2);
9+
10+
// Deletion
11+
// This .pop() method removes the last-added element of the array.
12+
const array_deletion: number[] = [1, 2, 3, 4];
13+
array_deletion.pop();
14+
array_deletion.pop();
15+
16+
// This .shift() method will remove the first element and return it.
17+
array_deletion.shift();
18+
array_deletion.shift();

0 commit comments

Comments
 (0)