aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/javascript/reference/global_objects/symbol/description/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/javascript/reference/global_objects/symbol/description/index.html
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/ja/web/javascript/reference/global_objects/symbol/description/index.html')
-rw-r--r--files/ja/web/javascript/reference/global_objects/symbol/description/index.html66
1 files changed, 66 insertions, 0 deletions
diff --git a/files/ja/web/javascript/reference/global_objects/symbol/description/index.html b/files/ja/web/javascript/reference/global_objects/symbol/description/index.html
new file mode 100644
index 0000000000..581ebe83bd
--- /dev/null
+++ b/files/ja/web/javascript/reference/global_objects/symbol/description/index.html
@@ -0,0 +1,66 @@
+---
+title: Symbol.prototype.description
+slug: Web/JavaScript/Reference/Global_Objects/Symbol/description
+tags:
+ - JavaScript
+ - Property
+ - Prototype
+ - Symbol
+translation_of: Web/JavaScript/Reference/Global_Objects/Symbol/description
+---
+<div>{{JSRef}}</div>
+
+<p>読み取り専用 <code><strong>description</strong></code> プロパティは、 {{JSxRef("Symbol")}} オブジェクトのオプションの説明を返す文字列です。</p>
+
+<div>{{EmbedInteractiveExample("pages/js/symbol-prototype-description.html")}}</div>
+
+
+
+<h2 id="解説">解説</h2>
+
+<p>{{JSxRef("Symbol")}} オブジェクトは、オプションの説明を使用して作成できます。これはデバッグには使用できますが、シンボル自体にはアクセスできません。 <code>Symbol.prototype.description</code> プロパティを使用して、その説明を読み取ることができます。囲んでいる "<code>Symbol()</code>" 文字列が含まれていないため、 <code>Symbol.prototype.toString()</code> とは異なります。例を参照してください。</p>
+
+<h2 id="例">例</h2>
+
+<h3 id="description_を使用する">description を使用する</h3>
+
+<pre class="brush: js notranslate">Symbol('desc').toString(); // "Symbol(desc)"
+Symbol('desc').description; // "desc"
+Symbol('').description; // ""
+Symbol().description; // undefined
+
+// well-known symbols
+Symbol.iterator.toString(); // "Symbol(Symbol.iterator)"
+Symbol.iterator.description; // "Symbol.iterator"
+
+// global symbols
+Symbol.for('foo').toString(); // "Symbol(foo)"
+Symbol.for('foo').description; // "foo"
+
+</pre>
+
+<h2 id="仕様">仕様</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">仕様</th>
+ </tr>
+ <tr>
+ <td>{{SpecName("ESDraft", "#sec-symbol.prototype.description", "get Symbol.prototype.description")}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="ブラウザーの互換性">ブラウザーの互換性</h2>
+
+
+
+<p>{{Compat("javascript.builtins.Symbol.description")}}</p>
+
+<h2 id="関連項目">関連項目</h2>
+
+<ul>
+ <li>{{JSxRef("Symbol.prototype.toString()")}}</li>
+ <li>Polyfill: <a href="https://npmjs.com/symbol.prototype.description">https://npmjs.com/symbol.prototype.description</a></li>
+</ul>