- ๐ฆ๐ต๐ถ๐ณ๐ ๐ ๐ฒ๐๐ต๐ผ๐ฑ
The shift method is like the pop method, but it only works at the beginning of the array.
The shift method ๐ฝ๐๐น๐น๐ ๐๐ต๐ฒ ๐ณ๐ถ๐ฟ๐๐ ๐ฒ๐น๐ฒ๐บ๐ฒ๐ป๐ ๐ผ๐ณ๐ณ of the given array and returns it.
This method will ๐ฐ๐ต๐ฎ๐ป๐ด๐ฒ ๐๐ต๐ฒ ๐ผ๐ฟ๐ถ๐ด๐ถ๐ป๐ฎ๐น ๐ฎ๐ฟ๐ฟ๐ฎ๐.
Syntax: array.shift()
- ๐จ๐ป๐๐ต๐ถ๐ณ๐ ๐ ๐ฒ๐๐ต๐ผ๐ฑ
The unshift method is like the push method, but it only works at the beginning of the array.
The unshift method ๐ฎ๐ฑ๐ฑ๐ ๐ป๐ฒ๐ ๐ถ๐๐ฒ๐บ๐ ๐๐ผ ๐๐ต๐ฒ ๐ฏ๐ฒ๐ด๐ถ๐ป๐ป๐ถ๐ป๐ด of an array and returns the new length.
This method will ๐ฐ๐ต๐ฎ๐ป๐ด๐ฒ ๐๐ต๐ฒ ๐ผ๐ฟ๐ถ๐ด๐ถ๐ป๐ฎ๐น ๐ฎ๐ฟ๐ฟ๐ฎ๐.
Syntax: array.unshift(item1, item2, ..., itemx)
๐๐ ๐ฎ๐บ๐ฝ๐น๐ฒ ๐