Skip to content

Commit 5a7e50a

Browse files
committed
Added Array/push.js
1 parent 387655c commit 5a7e50a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Array Methods/push.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Lets create a persons array with four elements,
2+
let people = ["Gustavo", "Lucio", "Julio", "Luan"];
3+
4+
// removes the last element from the people array
5+
let length = people.push("Louise");
6+
7+
console.log(`Output: ${people}`)
8+
// Output: Gustavo,Lucio,Julio,Luan,Louise
9+
10+
console.log(`Output: ${length}`)
11+
// Output: 5

0 commit comments

Comments
 (0)