freeCodeCamp/guide/spanish/certifications/javascript-algorithms-and-data-structures/basic-javascript/manipulate-arrays-with-unshift/index.md
2018-10-16 21:32:40 +05:30

365 B

title localeTitle
Manipulate Arrays With unshift() Manipular matrices con unshift ()

Manipular matrices con unshift ()

Mientras push() agrega elementos a la parte posterior de la matriz, unshift() agrega al frente. Todo lo que tienes que hacer es:

var arr = [2, 3, 4, 5]; 
 arr.unshift(1); // Now, the array has 1 in the front