mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-26 03:02:39 -05:00
359 B
359 B
title, localeTitle
| title | localeTitle |
|---|---|
| Manipulate Arrays With unshift() | Manipular matrizes com unshift () |
Manipular matrizes com unshift ()
Enquanto push() adicionava elementos à parte de trás da matriz, unshift() adiciona à frente. Tudo o que tem a fazer é:
var arr = [2, 3, 4, 5];
arr.unshift(1); // Now, the array has 1 in the front