From 3d9227f8d11cf28c9999054afa2d63b83ef38b3d Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Sun, 26 Sep 2021 00:07:38 +0900 Subject: Markdown へ変換するためにファイル名を変更 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operators/addition_assignment/index.html | 78 ---------------------- 1 file changed, 78 deletions(-) delete mode 100644 files/ja/web/javascript/reference/operators/addition_assignment/index.html (limited to 'files/ja/web/javascript/reference/operators/addition_assignment/index.html') diff --git a/files/ja/web/javascript/reference/operators/addition_assignment/index.html b/files/ja/web/javascript/reference/operators/addition_assignment/index.html deleted file mode 100644 index ca9497a6da..0000000000 --- a/files/ja/web/javascript/reference/operators/addition_assignment/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: 加算代入 (+=) -slug: Web/JavaScript/Reference/Operators/Addition_assignment -tags: - - Assignment operator - - JavaScript - - Language feature - - Operator - - Reference -translation_of: Web/JavaScript/Reference/Operators/Addition_assignment ---- -
{{jsSidebar("Operators")}}
- -

加算代入演算子 (+=) は、右辺のオペランドの値を変数に加算し、結果を変数に代入します。 2つのオペランドの型は、加算代入演算子の動作を決定します。加算もしくは連結が可能です。

- -
{{EmbedInteractiveExample("pages/js/expressions-addition-assignment.html")}}
- -
- - - -

構文

- -
Operator: x += y
-Meaning:  x  = x + y
- -

- -

加算代入の使用

- -
// 以下の変数を想定
-//  foo = 'foo'
-//  bar = 5
-//  baz = true
-
-// 数値 + 数値 -> 加算
-bar += 2 // 7
-
-// ブール値 + 数値 -> 加算
-baz += 1 // 2
-
-// ブール値 + ブール値 -> 加算
-baz += false // 1
-
-// 数値 + 文字列 -> 連結
-bar += 'foo' // "5foo"
-
-// 文字列 + ブール値 -> 連結
-foo += false // "foofalse"
-
-// 文字列 + 文字列 -> 連結
-foo += 'bar' // "foobar"
- -

仕様

- - - - - - - - - - -
仕様
{{SpecName('ESDraft', '#sec-assignment-operators', 'Assignment operators')}}
- -

ブラウザーの互換性

- - - -

{{Compat("javascript.operators.addition_assignment")}}

- -

関連項目

- - -- cgit v1.2.3-54-g00ecf