The shift method removes the chemical component subdivision at the 0'th index together with shifts the values at consecutive indexes down, hence returns the removed value. If the length holding is 0, undefined is returned.
Syntax Array.shift()
Example [1,2,3,4,5,6].shift()
Example Program:- (Editor)
Editor is Loading...
Output:-
Advertisement
Tidak ada komentar:
Posting Komentar