poke(value)

Replaces the value at the beginning of a collection, the value that would be returned by shift().

On collections

Usage

  • poke(value)

Example

var array = [1, 2, 3];
array.poke(4);
array

Related

  • peek()

    Returns the value at the beginning of a collection, the value that would be returned by shift().

  • pokeBack(value)

    Replaces the value at the end of a collection, the value that would be returned by pop().

  • shift()

    Removes a value from the beginning of a collection, and returns that value.

  • unshift(...values)

    Adds values to the beginning of a collection.