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 article needs an editorial review. How you can help.

This is a new technology, part of the ECMAScript 2015 (ES6) standard.
This technology's specification has been finalized, but check the compatibility table for usage and implementation status in various browsers.

La propietat WeakMap.prototype representa el prototip pel constructor WeakMap.

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

Descripció

Les instantànies WeakMap hereten de WeakMap.prototype. Es pot utilitzar l'objecte prototip del constructor per afegir propietats o mètodes a totes les instàncies WeakMap.

WeakMap.prototype és en si mateix només un objecte ordinari:

Object.prototype.toString.call(WeakMap.prototype); // "[object Object]"

Propietats

WeakMap.prototype.constructor
Retorna la funció que ha creat un prototip de la instància. Aquesta és la funció WeakMap per defecte.

Mètodes

WeakMap.prototype.delete(key)
Elimina qualsevol valor associat a key. WeakMap.prototype.has(key) retornarà false després d'això.
WeakMap.prototype.get(key)
Retorna el valor associat a key, o undefined si no n'hi ha cap.
WeakMap.prototype.has(key)
Retorna un booleà afirmant si un valor s'ha associat o no a la key en l'objecte WeakMap.
WeakMap.prototype.set(key, value)
Estableix el valor per la key en l'objecte WeakMap. Retorna l'objecte WeakMap.
WeakMap.prototype.clear()
Elimina totes les parelles clau/valor de l'objecte WeakMap. Vegeu que es posible implementar un objecte WeakMap-like que tingui un mètode .clear() per mitjà d'encapsular un objecte WeakMap que no ho tingui (vegeu un exemple a la pàgina WeakMap)

Especificacions

Especificació Estat Comentaris
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'WeakMap.prototype' in that specification.
Standard Definició inicial

Compatibilitat amb navegadors

Característica Chrome Firefox (Gecko) Internet Explorer Opera Safari
Suport bàsic 36 6.0 (6.0) 11 23 7.1
Objecte ordinari ? 40 (40) ? ? ?
Característica Android Chrome per Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Suport bàsic Not supported Not supported 6.0 (6.0) Not supported Not supported 8
Objecte ordinari ? ? 40.0 (40) ? ? ?

Vegeu també

Document Tags and Contributors

 Contributors to this page: llue
 Last updated by: llue,