mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-25 18:02:11 -05:00
592 B
592 B
title, localeTitle
| title | localeTitle |
|---|---|
| Manipulate Arrays With pop() | Manipular Arrays Com pop () |
Manipular Arrays Com pop ()
Explicação do Problema
Livre-se do último elemento da matriz. Em seguida, atribua esse elemento montado a removedFromMyArray .
Sugestão 1:
Chame .pop() na matriz e atribua-a a removedFromMyArray .
Spoiler! Solução de Código:
var removedFromMyArray = myArray.pop();
=======
Remove the last element of an array with the pop() method, like so:
javascript var arr = [1, 2, 3, 4, 5]; arr.pop (); // Isso se livrou de 5
`` `