Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

WeakMap.prototype

This is an experimental technology, part of the ECMAScript 6 (Harmony) proposal.
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future version of browsers as the spec changes.

Sumário

A propriedade WeakMap.prototype representa o prototype fara o construtor WeakMap.

Property attributes of WeakMap.prototype
Writable no
Enumerable no
Configurable no

Descrição

Instâncias WeakMap herdam de WeakMap.prototype. Você pode usar o objeto prototype do construtor para adicionar propriedades ou métodos para todas as instâncias WeakMap.

Propriedades

WeakMap.prototype.constructor
Retorna a função construtora das instâncias, neste caso a própria WeakMap.

Metodos

WeakMap.prototype.clear()
Remove todos os pares chave/valor do objeto WeakMap
WeakMap.prototype.delete(key)
Remove qualquer valor associado à  keyWeakMap.prototype.has(key) e retorna false após.
WeakMap.prototype.get(key)
Retorna o valor associado a key, ou undefined se nenhum existir.
WeakMap.prototype.has(key)
Retorna um Boolean verificando se há algum valor associado a key no objeto WeakMap ou não.
WeakMap.prototype.set(key, value)
Configura um valor para key no objeto WeakMap. Retorna undefined.

Especificações

Especificação Status Comentário
ECMAScript 6 (ECMA-262)
The definition of 'WeakMap.prototype' in that specification.
Release Candidate Especificação inicial.

Compatibilidade de browsers 

Recurso Chrome Firefox (SpiderMonkey) Internet Explorer Opera Safari
Suporte básico (Yes) 6.0 (6.0) 11 Não suportado Não suportado
Recurso Android Firefox Mobile (SpiderMonkey) IE Mobile Opera Mobile Safari Mobile
Suporte básico Não suportado 6.0 (6.0) Não suportado Não suportado Não suportado

Notas para o Chrome

  • O recurso é ativado por preferência. Em chrome://flags ative "Enable Experimental JavaScript".

Veja também

Etiquetas do documento e colaboradores

 Colaboradores desta página: teoli, gabrielrubens
 Última atualização por: teoli,