pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Set/add

ript>

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

Set.prototype.add()

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.

O método add() acrescenta um novo elemento com o valor especificado no final de um objeto Set.

Sintaxe

mySet.add(value);

Parâmetros

value

Requerido. O valor de um elemento a ser adicionado ao objeto Set.

Valor de retorno

O objeto Set.

Exemplos

Usando o método add

js
var mySet = new Set();

mySet.add(1);
mySet.add(5).add("some text"); // pode ser encadeado

console.log(mySet);
// Set [1, 5, "some text"]

Especificações

Specification
ECMAScript® 2027 Language Specification
# sec-set.prototype.add

Compatilidade de Navegadores (Browser)

Notas específicas para Firefox

  • Antes do Firefox 33, Set.prototype.add retornava undefined e não era possível encadear chamadas. Isto foi resolvido (Erro do Firefox 1031632). O comportamento pode ser encontrado no Chrome/v8 (issue).

Veja também

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy