Table of Contents
- Code and its explanation
- Limitations and caveats
By doing so, the element in the zeroth index is removed and the items in the consecutive indexes are moved forward.
Eg: In arr = [ “a”,”b”,”c”] after Shift is used the element “a” is removed and the subsequent elements are moved up 1 index, i.e “b” whose index was 1 initially is moved to 0
Where array refers to the name of the string.
Code and its explanation:
Limitations and caveats
- The Shift function returns undefined if the array is empty