From a55b575e8089ee6cab7c5c262a7e6db55d0e34d6 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:46:50 +0100 Subject: unslug es: move --- .../global_objects/weakmap/has/index.html | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 files/es/web/javascript/reference/global_objects/weakmap/has/index.html (limited to 'files/es/web/javascript/reference/global_objects/weakmap/has') diff --git a/files/es/web/javascript/reference/global_objects/weakmap/has/index.html b/files/es/web/javascript/reference/global_objects/weakmap/has/index.html new file mode 100644 index 0000000000..dd978ede16 --- /dev/null +++ b/files/es/web/javascript/reference/global_objects/weakmap/has/index.html @@ -0,0 +1,83 @@ +--- +title: WeakMap.prototype.has() +slug: Web/JavaScript/Referencia/Objetos_globales/WeakMap/has +tags: + - ECMAScript6 + - JavaScript + - Method + - Protocols + - WeakMap +translation_of: Web/JavaScript/Reference/Global_Objects/WeakMap/has +--- +
{{JSRef}}
+ +

El método has() devuelve un boleano indicando ya sea, si el elemento con la llave específica existe o no en el objeto WeakMap.

+ +
{{EmbedInteractiveExample("pages/js/weakmap-prototype-has.html")}}
+ + + +

Sintaxis

+ +
wm.has(key);
+ +

Parámetros

+ +
+
identificador (key)
+
Requerido. La llave del elemento a comprobar en el objeto WeakMap.
+
+ +

Valor devuelto

+ +
+
Boolean
+
Devuelve true si el elemento con la llave específica existe en el objeto WeakMap; de no encontrarse, devolverá false.
+
+ +

Ejemplos

+ +

Utilización del método has 

+ +
var wm = new WeakMap();
+wm.set(window, 'foo');
+
+wm.has(window); // Devuelve true
+wm.has('baz');  // Devuelve false
+
+ +

Especificaciones

+ + + + + + + + + + + + + + + + + + + +
EspecificaciónEstadoComentarios
{{SpecName('ES2015', '#sec-weakmap.prototype.has', 'WeakMap.prototype.has')}}{{Spec2('ES2015')}}Definición inicial.
{{SpecName('ESDraft', '#sec-weakmap.prototype.has', 'WeakMap.prototype.has')}}{{Spec2('ESDraft')}} 
+ +

Compatibilidad con navegadores

+ + + +

{{Compat("javascript.builtins.WeakMap.has")}}

+ +

Vea también

+ + -- cgit v1.2.3-54-g00ecf