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

601 B

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

Manipular matrices con pop ()

Explicación del problema

Deshazte del último elemento de la matriz. Luego, asigne ese elemento montado a removedFromMyArray .

Sugerencia 1:

Llame a .pop() en la matriz y asígnele a removedFromMyArray .

Spoiler! Solución 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 (); // Esto se deshizo de 5

`` `