Edit This Page

unshift(...items)

Add items at the beginning of the Enumerable. This is the equivalent of Array.prototype.unshift

Arguments

  • ...items (any): values to insert at the beginning of the Enumerable

Returns

(Enumerable): New Enumerable with the given items.

Example

Enumerable
        .from([3, 4, 5]))
        .unshift(1, 2)
        .toArray();
// [1, 2, 3, 4, 5]