aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/javascript/reference/operators/addition_assignment
diff options
context:
space:
mode:
authorMasahiro FUJIMOTO <mfujimot@gmail.com>2021-09-26 01:32:15 +0900
committerMasahiro FUJIMOTO <mfujimot@gmail.com>2021-10-03 13:37:37 +0900
commitfb129cca2082cbc57f93025a2e46797e5fb4a0f3 (patch)
treeea14ee032bb589704833b4cf6bf9bf79f973cc1d /files/ja/web/javascript/reference/operators/addition_assignment
parent3d9227f8d11cf28c9999054afa2d63b83ef38b3d (diff)
downloadtranslated-content-fb129cca2082cbc57f93025a2e46797e5fb4a0f3.tar.gz
translated-content-fb129cca2082cbc57f93025a2e46797e5fb4a0f3.tar.bz2
translated-content-fb129cca2082cbc57f93025a2e46797e5fb4a0f3.zip
代入演算子の文書を更新
- 2021/07/21 時点の英語版に更新
Diffstat (limited to 'files/ja/web/javascript/reference/operators/addition_assignment')
-rw-r--r--files/ja/web/javascript/reference/operators/addition_assignment/index.md59
1 files changed, 23 insertions, 36 deletions
diff --git a/files/ja/web/javascript/reference/operators/addition_assignment/index.md b/files/ja/web/javascript/reference/operators/addition_assignment/index.md
index 3a3645d2ab..fabea99ceb 100644
--- a/files/ja/web/javascript/reference/operators/addition_assignment/index.md
+++ b/files/ja/web/javascript/reference/operators/addition_assignment/index.md
@@ -7,72 +7,59 @@ tags:
- 言語機能
- 演算子
- Reference
+browser-compat: javascript.operators.addition_assignment
translation_of: Web/JavaScript/Reference/Operators/Addition_assignment
---
{{jsSidebar("Operators")}}
-加算代入演算子 (`+=`) は、右辺のオペランドの値を変数に加算し、結果を変数に代入します。 2つのオペランドの型は、加算代入演算子の動作を決定します。加算もしくは連結が可能です。
+加算代入演算子 (`+=`) は、右オペランドの値を変数に加算し、結果を変数に代入します。2 つのオペランドの型が加算代入演算子の動作を決定します。加算もしくは連結が可能です。
{{EmbedInteractiveExample("pages/js/expressions-addition-assignment.html")}}
-<div></div>
-
-
-
## 構文
-<pre class="syntaxbox notranslate"><strong>Operator:</strong> x += y
-<strong>Meaning:</strong> x = x + y</pre>
+```js
+x += y // x = x + y
+```
## 例
-<h3 id="加算代入の使用">加算代入の使用</h3>
+### 加算代入の使用
-<pre class="brush: js notranslate">// 以下の変数を想定
+```js
+// 以下の変数を想定
// foo = 'foo'
// bar = 5
// baz = true
-// 数値 + 数値 -&gt; 加算
+// 数値 + 数値 -> 加算
bar += 2 // 7
-// ブール値 + 数値 -&gt; 加算
+// 論理値 + 数値 -> 加算
baz += 1 // 2
-// ブール値 + ブール値 -&gt; 加算
+// 論理値 + 論理値 -> 加算
baz += false // 1
-// 数値 + 文字列 -&gt; 連結
+// 数値 + 文字列 -> 連結
bar += 'foo' // "5foo"
-// 文字列 + ブール値 -&gt; 連結
+// 文字列 + 論理値 -> 連結
foo += false // "foofalse"
-// 文字列 + 文字列 -&gt; 連結
-foo += 'bar' // "foobar"</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>
+// 文字列 + 文字列 -> 連結
+foo += 'bar' // "foobar"
+```
-<h2 id="ブラウザーの互換性">ブラウザーの互換性</h2>
+## 仕様書
+{{Specifications}}
+## ブラウザーの互換性
-{{Compat("javascript.operators.addition_assignment")}}
+{{Compat}}
-<h2 id="関連項目">関連項目</h2>
+## 関連情報
-<ul>
- <li><a href="/ja/docs/Web/JavaScript/Guide/Expressions_and_Operators#Assignment">代入演算子</a></li>
- <li><a href="/ja/docs/Web/JavaScript/Reference/Operators/Addition">加算演算子</a></li>
-</ul>
+- [JavaScript ガイドの代入演算子](/ja/docs/Web/JavaScript/Guide/Expressions_and_Operators#assignment)
+- [加算演算子](/ja/docs/Web/JavaScript/Reference/Operators/Addition)