A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Set/clear below:

Set.prototype.clear() - JavaScript | MDN

MDN Web Docs
  1. Tecnologia Web para desenvolvedores
  2. JavaScript
  3. Referência JavaScript
  4. Objetos Globais
  5. Set
  6. Set.prototype.clear()

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

Filter sidebar

Neste artigo
  1. Objetos Globais
  2. Set
  3. Construtor
    1. Set()
  4. Propriedades estáticas
    1. [Symbol.species]
  5. Métodos de instância
    1. Set.prototype.add()
    2. Set.prototype.clear()
    3. Set.prototype.delete()
    4. difference()
    5. Set.prototype.entries()
    6. forEach()
    7. Set.prototype.has()
    8. intersection()
    9. isDisjointFrom()
    10. isSubsetOf()
    11. isSupersetOf()
    12. keys()
    13. symmetricDifference()
    14. union()
    15. Set.prototype.values()
    16. [Symbol.iterator]()
  6. Propriedades de instância
    1. size
  7. Herança
  8. Object/Function
  9. Métodos estáticos
    1. Function.prototype.apply()
    2. Function.prototype.bind()
    3. Function.prototype.call()
    4. Function.prototype.toString()
    5. [Symbol.hasInstance]()
  10. Propriedades estáticas
    1. Function.displayName Não padrão
    2. Function.length
    3. Function.name
    4. prototype
    5. Function.arguments Não padrão Deprecated
    6. Function.caller Não padrão Deprecated
  11. Métodos de instância
    1. Object.prototype.__defineGetter__() Deprecated
    2. Object.prototype.__defineSetter__() Deprecated
    3. Object.prototype.__lookupGetter__() Deprecated
    4. Object.prototype.__lookupSetter__() Deprecated
    5. Object.prototype.hasOwnProperty()
    6. Object.prototype.isPrototypeOf()
    7. Object.prototype.propertyIsEnumerable()
    8. Object.prototype.toLocaleString()
    9. Object.prototype.toString()
    10. Object.prototype.valueOf()
  12. Propriedades de instância
    1. Object.prototype.__proto__ Deprecated
    2. Object.prototype.constructor
Neste artigo Set.prototype.clear()

Baseline Widely available

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

O método clear() remove todos os elementos de um objeto Set.

Sintaxe
mySet.clear();
Exemplos Usando o método clear

js

var mySet = new Set();
mySet.add(1);
mySet.add("foo");

mySet.size; // 2
mySet.has("foo"); // true

mySet.clear();

mySet.size; // 0
mySet.has("bar"); // false
Especificações Specification ECMAScript® 2026 Language Specification
# sec-set.prototype.clear
Compatibilidade com navegadores Veja também Help improve MDN Was this page helpful to you? Learn how to contribute

.

This page was last modified on 8 de nov. de 2023 by MDN contributors.

View this page on GitHub

•

Report a problem with this content

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4