--- title: WeakSet.prototype.has() slug: Web/JavaScript/Reference/Global_Objects/WeakSet/has tags: - ECMAScript6 - JavaScript - Method - Prototype - WeakSet translation_of: Web/JavaScript/Reference/Global_Objects/WeakSet/has ---
Метод has() определяет, содержит ли WeakSet определённый элемент, возвращая в зависимости от этого true или false.
ws.has(value);
has var ws = new WeakSet();
var obj = {};
ws.add(window);
mySet.has(window); // вернёт true
mySet.has(obj); // вернёт false
{{Compat}}