GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • MDN
  • HTML: Markup language
  • Elements
  • Global attributes
  • Attributes
  • See all…
  • Responsive images
  • HTML cheatsheet
  • Date & time formats
  • See all…
  • SVG
  • MathML
  • XML
  • CSS: Styling language

This view

  • Original page
  • New address

GeezerVison is showing developer.mozilla.org — Array.prototype.pop() - JavaScript | MDN

Esta página foi traduzida do inglês pela comunidade. Saiba mais e junte-se à comunidade MDN Web Docs.

View in English Always switch to English

Array.prototype.pop()

Baseline
Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since julho de 2015.

  • See full compatibility
  • Learn more

Resumo

O método pop() remove o último elemento de um array e retorna aquele elemento.

Sintaxe

arr.pop()

Descrição

O método pop remove o último elemento de um array e retorna aquele valor.

Esse método é intencionalmente genérico. Podendo ser utilizado por call ou apply em objetos que implementam arrays.

Se você chamar pop() em um array vazio, ele retorna o valor undefined.

Exemplos

Exemplo: Removendo o último elemento de um array

O código seguinte cria o array meuPeixe contendo quatro elementos e então remove seu último elemento.

js
var meuPeixe = ["acara-bandeira", "palhaco", "mandarim", "esturjao"];

console.log(meuPeixe); // ['acara-bandeira', 'palhaco', 'mandarim', 'esturjao']

var meuPeixePop = meuPeixe.pop();

console.log(meuPeixe); // ['acara-bandeira', 'palhaco', 'mandarim' ]

console.log(meuPeixePop); // 'esturjao'

Especificações

Specification
ECMAScript® 2027 Language Specification
# sec-array.prototype.pop

Compatibilidade nos Navegadores

Veja também

  • Array.prototype.push()
  • Array.prototype.shift()
  • Array.prototype.unshift()

Help improve MDN

Learn how to contribute

This page was last modified on 22 de mai. de 2026 by MDN contributors.

View this page on GitHub • Report a problem with this content
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.