diff options
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/symbol')
10 files changed, 16 insertions, 409 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/symbol/for/index.html b/files/zh-cn/web/javascript/reference/global_objects/symbol/for/index.html index 2b5df3a89c..ebb9e724e9 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/symbol/for/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/symbol/for/index.html @@ -97,55 +97,7 @@ Symbol.for("mdn.bar"); <h2 id="浏览器兼容性">浏览器兼容性</h2> -<p>{{ CompatibilityTable() }}</p> - -<div> -<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>{{ CompatChrome(40) }}</td> - <td>{{ CompatGeckoDesktop("36.0") }}</td> - <td>{{ CompatNo() }}</td> - <td>{{ CompatNo() }}</td> - <td>10</td> - </tr> - </tbody> -</table> -</div> - -<div> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Chrome for 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>{{ CompatNo() }}</td> - <td>{{ CompatGeckoMobile("36.0") }}</td> - <td>{{ CompatNo() }}</td> - <td>{{ CompatNo() }}</td> - <td>{{ CompatNo() }}</td> - </tr> - </tbody> -</table> -</div> +{{Compat}} <h2 id="See_Also">相关链接</h2> diff --git a/files/zh-cn/web/javascript/reference/global_objects/symbol/index.html b/files/zh-cn/web/javascript/reference/global_objects/symbol/index.html index a0165478d4..2448eb3d7f 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/symbol/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/symbol/index.html @@ -77,13 +77,13 @@ typeof symObj; // "object"</pre> <dl> <dt> - <h4 id="迭代_symbols">迭代 symbols {{jsxref("Symbol.iterator")}}</h4> + 迭代 symbols {{jsxref("Symbol.iterator")}} </dt> <dd>一个返回一个对象默认迭代器的方法。被 <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of">for...of</a></code> 使用。</dd> <dt>{{jsxref("Symbol.asyncIterator")}} {{experimental_inline}}</dt> <dd>一个返回对象默认的异步迭代器的方法。被 <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of">for await of</a></code> 使用。</dd> <dt> - <h4 id="正则表达式_symbols">正则表达式 symbols {{jsxref("Symbol.match")}}</h4> + 正则表达式 symbols {{jsxref("Symbol.match")}} </dt> <dd>一个用于对字符串进行匹配的方法,也用于确定一个对象是否可以作为正则表达式使用。被 {{jsxref("String.prototype.match()")}} 使用。</dd> <dt>{{jsxref("Symbol.replace")}}</dt> @@ -93,7 +93,7 @@ typeof symObj; // "object"</pre> <dt>{{jsxref("Symbol.split")}}</dt> <dd>一个在匹配正则表达式的索引处拆分一个字符串的方法.。被 {{jsxref("String.prototype.split()")}} 使用。</dd> <dt> - <h4 id="其他_symbols">其他 symbols {{jsxref("Symbol.hasInstance")}}</h4> + 其他 symbols {{jsxref("Symbol.hasInstance")}} </dt> <dd>一个确定一个构造器对象识别的对象是否为它的实例的方法。被 {{jsxref("Operators/instanceof", "instanceof")}} 使用。</dd> <dt>{{jsxref("Symbol.isConcatSpreadable")}}</dt> @@ -167,7 +167,7 @@ typeof Symbol.iterator === 'symbol' <p>Symbols 在 <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in"><code>for...in</code></a> 迭代中不可枚举。另外,{{jsxref("Object.getOwnPropertyNames()")}} 不会返回 symbol 对象的属性,但是你能使用 {{jsxref("Object.getOwnPropertySymbols()")}} 得到它们。</p> -<pre class="brush: js line-numbers language-js">var obj = {}; +<pre class="brush: js">var obj = {}; obj[Symbol("a")] = "a"; obj[Symbol.for("b")] = "b"; diff --git a/files/zh-cn/web/javascript/reference/global_objects/symbol/keyfor/index.html b/files/zh-cn/web/javascript/reference/global_objects/symbol/keyfor/index.html index 9877b68ce0..76daeafd72 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/symbol/keyfor/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/symbol/keyfor/index.html @@ -22,9 +22,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Symbol/keyFor <h3 id="返回值">返回值</h3> -<dl> - <dd>如果全局注册表中查找到该symbol,则返回该symbol的key值,返回值为字符串类型。否则返回undefined</dd> -</dl> +<p>如果全局注册表中查找到该symbol,则返回该symbol的key值,返回值为字符串类型。否则返回undefined</p> <h2 id="示例">示例</h2> @@ -58,55 +56,7 @@ Symbol.keyFor(Symbol.iterator) // undefined <h2 id="浏览器兼容性">浏览器兼容性</h2> -<p>{{ CompatibilityTable() }}</p> - -<div> -<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>{{ CompatNo() }}</td> - <td>{{ CompatGeckoDesktop("33.0") }}</td> - <td>{{ CompatNo() }}</td> - <td>{{ CompatNo() }}</td> - <td>{{ CompatNo() }}</td> - </tr> - </tbody> -</table> -</div> - -<div> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Chrome for 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>{{ CompatNo() }}</td> - <td>{{ CompatGeckoMobile("33.0") }}</td> - <td>{{ CompatNo() }}</td> - <td>{{ CompatNo() }}</td> - <td>{{ CompatNo() }}</td> - </tr> - </tbody> -</table> -</div> +{{Compat}} <h2 id="See_Also">相关链接</h2> diff --git a/files/zh-cn/web/javascript/reference/global_objects/symbol/search/index.html b/files/zh-cn/web/javascript/reference/global_objects/symbol/search/index.html index 7f3ac000d6..f37ad018db 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/symbol/search/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/symbol/search/index.html @@ -53,55 +53,7 @@ console.log('foobar'.search(new caseInsensitiveSearch('BaR'))); <h2 id="浏览器兼容性">浏览器兼容性</h2> -<p>{{CompatibilityTable}}</p> - -<div> -<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>基本支持</td> - <td>{{CompatChrome(50)}}</td> - <td>{{ CompatGeckoDesktop(49) }}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<div> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Chrome for Android</th> - <th>Firefox Mobile (Gecko)</th> - <th>IE Mobile</th> - <th>Opera Mobile</th> - <th>Safari Mobile</th> - </tr> - <tr> - <td>基本支持</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{ CompatGeckoMobile(49) }}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> +{{Compat}} <h2 id="参见">参见</h2> diff --git a/files/zh-cn/web/javascript/reference/global_objects/symbol/split/index.html b/files/zh-cn/web/javascript/reference/global_objects/symbol/split/index.html index 220716da29..ce514451d9 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/symbol/split/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/symbol/split/index.html @@ -55,55 +55,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Symbol/split <h2 id="浏览器兼容性">浏览器兼容性</h2> -<p>{{CompatibilityTable}}</p> - -<div> -<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>{{CompatChrome(50)}}</td> - <td>{{ CompatGeckoDesktop(49) }}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<div> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Chrome for 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>{{CompatNo}}</td> - <td>{{ CompatGeckoMobile(49) }}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> +{{Compat}} <h2 id="参阅">参阅</h2> diff --git a/files/zh-cn/web/javascript/reference/global_objects/symbol/toprimitive/index.html b/files/zh-cn/web/javascript/reference/global_objects/symbol/toprimitive/index.html index bbf27b98d6..18c1c5a6e9 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/symbol/toprimitive/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/symbol/toprimitive/index.html @@ -68,14 +68,7 @@ console.log(obj2 + ""); // "true" -- hint 参数值是 "default" <h2 id="浏览器兼容性">浏览器兼容性</h2> -<p> {{Compat("javascript.builtins.Symbol.toPrimitive")}}</p> - -<div> -<table class="compat-table"> - <tbody> - </tbody> -</table> -</div> +{{Compat}} <h2 id="其他资料">其他资料</h2> diff --git a/files/zh-cn/web/javascript/reference/global_objects/symbol/tosource/index.html b/files/zh-cn/web/javascript/reference/global_objects/symbol/tosource/index.html index 6342361cc9..87d28009f3 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/symbol/tosource/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/symbol/tosource/index.html @@ -34,57 +34,9 @@ sym.toSource()</pre> <p>还未成为任何标准的一部分</p> -<h2 id="Browser_compatibility">Browser compatibility</h2> - -<p>{{CompatibilityTable}}</p> - -<div> -<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>{{CompatNo}}</td> - <td>{{ CompatGeckoDesktop("36.0") }}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<div> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Chrome for 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>{{CompatNo}}</td> - <td>{{ CompatGeckoMobile("36.0") }}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +{{Compat}} <h2 id="See_also">See also</h2> diff --git a/files/zh-cn/web/javascript/reference/global_objects/symbol/tostring/index.html b/files/zh-cn/web/javascript/reference/global_objects/symbol/tostring/index.html index d59863f878..88ae116c0f 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/symbol/tostring/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/symbol/tostring/index.html @@ -59,55 +59,7 @@ Symbol.for("foo").toString() // "Symbol(foo)" <h2 id="浏览器兼容性">浏览器兼容性</h2> -<p>{{ CompatibilityTable() }}</p> - -<div> -<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>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatGeckoDesktop("33.0") }}</td> - <td>{{ CompatNo() }}</td> - <td>{{ CompatNo() }}</td> - <td>{{ CompatNo() }}</td> - </tr> - </tbody> -</table> -</div> - -<div> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Chrome for 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>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatGeckoMobile("33.0") }}</td> - <td>{{ CompatNo() }}</td> - <td>{{ CompatNo() }}</td> - <td>{{ CompatNo() }}</td> - </tr> - </tbody> -</table> -</div> +{{Compat}} <h2 id="See_Also">相关链接</h2> diff --git a/files/zh-cn/web/javascript/reference/global_objects/symbol/tostringtag/index.html b/files/zh-cn/web/javascript/reference/global_objects/symbol/tostringtag/index.html index 82f699b536..27f3bf4402 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/symbol/tostringtag/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/symbol/tostringtag/index.html @@ -72,55 +72,7 @@ Object.prototype.toString.call(new ValidatorClass()); // "[object Validator]" <h2 id="浏览器兼容性">浏览器兼容性</h2> -<p>{{CompatibilityTable}}</p> - -<div> -<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>{{CompatChrome(49)}}</td> - <td>{{CompatGeckoDesktop(51)}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatUnknown}}</td> - <td>{{CompatUnknown}}</td> - </tr> - </tbody> -</table> -</div> - -<div> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Chrome for 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>{{CompatUnknown}}</td> - <td>{{CompatUnknown}}</td> - <td>{{CompatGeckoMobile(51)}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatUnknown}}</td> - <td>{{CompatUnknown}}</td> - </tr> - </tbody> -</table> -</div> +{{Compat}} <h2 id="相关链接">相关链接</h2> diff --git a/files/zh-cn/web/javascript/reference/global_objects/symbol/valueof/index.html b/files/zh-cn/web/javascript/reference/global_objects/symbol/valueof/index.html index c9e9c55adb..e4a00990ca 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/symbol/valueof/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/symbol/valueof/index.html @@ -49,55 +49,7 @@ Object(Symbol("foo")).toString() + "bar"; <h2 id="浏览器兼容性">浏览器兼容性</h2> -<p>{{ CompatibilityTable() }}</p> - -<div> -<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>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatGeckoDesktop("33.0") }}</td> - <td>{{ CompatNo() }}</td> - <td>{{ CompatNo() }}</td> - <td>{{ CompatNo() }}</td> - </tr> - </tbody> -</table> -</div> - -<div> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Chrome for 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>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatVersionUnknown() }}</td> - <td>{{ CompatGeckoMobile("33.0") }}</td> - <td>{{ CompatNo() }}</td> - <td>{{ CompatNo() }}</td> - <td>{{ CompatNo() }}</td> - </tr> - </tbody> -</table> -</div> +{{Compat}} <h2 id="See_Also">相关链接</h2> |