unshift

[ˌənˈʃɪft]

unshift Definition

to add an element to the beginning of an array.

Using unshift: Examples

Take a moment to familiarize yourself with how "unshift" can be used in various situations through the following examples!

  • Example

    You can use the unshift method to add a new element to the beginning of an array.

  • Example

    The unshift operation is the opposite of the shift operation, which removes an element from the beginning of an array.

unshift Synonyms and Antonyms

Synonyms for unshift

📌

Summary: unshift in Brief

'Unshift' [ˌənˈʃɪft] is a verb that means to add an element to the beginning of an array. It is the opposite of the 'shift' operation, which removes an element from the beginning of an array. For example, you can use the 'unshift' method to add a new element to the front of an array.