diff options
Diffstat (limited to 'files/ja/web/javascript/reference/operators/assignment/index.md')
-rw-r--r-- | files/ja/web/javascript/reference/operators/assignment/index.md | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/files/ja/web/javascript/reference/operators/assignment/index.md b/files/ja/web/javascript/reference/operators/assignment/index.md new file mode 100644 index 0000000000..c6b8cf4ceb --- /dev/null +++ b/files/ja/web/javascript/reference/operators/assignment/index.md @@ -0,0 +1,62 @@ +--- +title: 代入 (=) +slug: Web/JavaScript/Reference/Operators/Assignment +tags: + - Assignment operator + - JavaScript + - Language feature + - Operator + - Reference +translation_of: Web/JavaScript/Reference/Operators/Assignment +--- +<div>{{jsSidebar("Operators")}}</div> + +<p>代入(単純代入)演算子 (<code>=</code>) は、変数に値を代入するために使用されます。割り当て操作は、割り当てられた値を評価します。 単一の値を複数の変数に割り当てるため、代入演算子の連鎖が可能です。</p> + +<div>{{EmbedInteractiveExample("pages/js/expressions-assignment.html")}}</div> + +<div></div> + + + +<h2 id="構文">構文</h2> + +<pre class="syntaxbox notranslate"><strong>Operator:</strong> x = y +</pre> + +<h2 id="例">例</h2> + +<h3 id="代入と連鎖">代入と連鎖</h3> + +<pre class="brush: js notranslate">// 以下の変数を想定 +// x = 5 +// y = 10 +// z = 25 + +x = y // x は 10 +x = y = z // x, y そして z は全て 25</pre> + +<h2 id="仕様">仕様</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">仕様書</th> + </tr> + <tr> + <td>{{SpecName('ESDraft', '#sec-assignment-operators', 'Assignment operators')}}</td> + </tr> + </tbody> +</table> + +<h2 id="ブラウザーの互換性">ブラウザーの互換性</h2> + + + +<p>{{Compat("javascript.operators.assignment")}}</p> + +<h2 id="関連項目">関連項目</h2> + +<ul> + <li><a href="/ja/docs/Web/JavaScript/Guide/Expressions_and_Operators#Assignment">代入演算子</a></li> +</ul> |