References

Array.pop()

Leírás

Kitöröli az Array példány utolsó elemét.

Szintaxis

pop()

Példa

const plants = ['broccoli', 'cauliflower', 'cabbage', 'kale', 'tomato']
 
console.log(plants.pop())
// Expected output: "tomato"
 
console.log(plants)
// Expected output: Array ["broccoli", "cauliflower", "cabbage", "kale"]
 
plants.pop()
 
console.log(plants)
// Expected output: Array ["broccoli", "cauliflower", "cabbage"]
in this article
back to top