freeCodeCamp/guide/portuguese/certifications/javascript-algorithms-and-d.../basic-javascript/manipulate-arrays-with-push/index.md

13 lines
315 B
Markdown
Raw Normal View History

---
title: Manipulate Arrays With push()
localeTitle: Manipular matrizes com push ()
---
## Manipular matrizes com push ()
O método `push()` permite acrescentar (adicionar ao final) um elemento a um array. Igual a…
```javascript
var arr = [1, 2, 3, 4];
arr.push(5); // Now, the array is [1, 2, 3, 4, 5]
```