diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:52 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:52 -0500 |
commit | 074785cea106179cb3305637055ab0a009ca74f2 (patch) | |
tree | e6ae371cccd642aa2b67f39752a2cdf1fd4eb040 /files/ru/web/javascript/reference/global_objects/weakset/has/index.html | |
parent | da78a9e329e272dedb2400b79a3bdeebff387d47 (diff) | |
download | translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.gz translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.bz2 translated-content-074785cea106179cb3305637055ab0a009ca74f2.zip |
initial commit
Diffstat (limited to 'files/ru/web/javascript/reference/global_objects/weakset/has/index.html')
-rw-r--r-- | files/ru/web/javascript/reference/global_objects/weakset/has/index.html | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/files/ru/web/javascript/reference/global_objects/weakset/has/index.html b/files/ru/web/javascript/reference/global_objects/weakset/has/index.html new file mode 100644 index 0000000000..abd00581e2 --- /dev/null +++ b/files/ru/web/javascript/reference/global_objects/weakset/has/index.html @@ -0,0 +1,124 @@ +--- +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 +--- +<div>{{JSRef("Global_Objects", "WeakSet")}}</div> + +<p>Метод <code><strong>has()</strong></code> определяет, содержит ли WeakSet определённый элемент, возвращая в зависимости от этого true или false. </p> + +<h2 id="Syntax" name="Syntax">Синтаксис</h2> + +<pre class="syntaxbox"><code><em>ws</em>.has(value);</code></pre> + +<h3 id="Parameters" name="Parameters">Параметры</h3> + +<dl> + <dt>value</dt> + <dd>Обязателен. Искомый объект.</dd> +</dl> + +<h3 id="Returns" name="Returns">Возвращаемое значение</h3> + +<dl> + <dt>Boolean</dt> + <dd>Если объект был найден в WeakSet вернёт true, иначе false.</dd> +</dl> + +<h2 id="Examples" name="Examples">Примеры</h2> + +<h3 id="Example:Using_the_has_method" name="Example:Using_the_has_method">Использование метода <code>has</code> </h3> + +<pre class="brush: js">var ws = new WeakSet(); +var obj = {}; +ws.add(window); + +mySet.has(window); // вернёт true +mySet.has(obj); // вернёт false +</pre> + +<h2 id="Specifications" name="Specifications">Спецификации</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('ES6', '#sec-weakset.prototype.has', 'WeakSet.prototype.has')}}</td> + <td>{{Spec2('ES6')}}</td> + <td>Изначальное определение.</td> + </tr> + <tr> + <td>{{SpecName('ESDraft', '#sec-weakset.prototype.has', 'WeakSet.prototype.has')}}</td> + <td>{{Spec2('ESDraft')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">Совместимость с браузерами</h2> + +<p>{{CompatibilityTable}}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Basic support</td> + <td>36</td> + <td>{{CompatGeckoDesktop(34)}}</td> + <td>{{CompatNo}}</td> + <td>23</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatNo}}</td> + <td>{{ CompatGeckoMobile(34) }}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<h2 id="See_also" name="See_also">Смотрите также</h2> + +<ul> + <li>{{jsxref("WeakSet")}}</li> + <li>{{jsxref("WeakSet.prototype.add()")}}</li> + <li>{{jsxref("WeakSet.prototype.delete()")}}</li> +</ul> |