Skip to content

Commit 77e970f

Browse files
author
Nuwan Chathuranga
committed
Change shift() to unshift() for inserting as first elelement to an array
1 parent a655264 commit 77e970f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

02-chapter-Array/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ There are several ways to add a new element to the array for example:
4444
grades.push(element);
4545
grades[grades.length + 1] = grade;
4646
47-
// use of shift() method will insert a new element at the front of the array.
48-
grades.shift(grade);
47+
// use of unshift() method will insert a new element at the front of the array.
48+
grades.unshift(grade);
4949
5050
//use of the splice() method will insert a new element at the position indicated.
5151
grades.splice(position, 0, grade);

0 commit comments

Comments
 (0)