.shift()

Description

Shift is a method that removes and returns the first value from an array

Parameters

Shift takes no parameters.

Usage On Arrays

arr = ["wow","hello","world"]
// setup the array

log arr.shift()
// returns "wow"
// the first value was removed

Last updated

Was this helpful?