From 94bc5410db5680cabc9261063e45bb92abfebd9d Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Sat, 25 Sep 2021 22:11:56 +0900 Subject: Operators/Addition を更新 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 2021/07/21 時点の英語版に同期 --- .../reference/operators/addition/index.md | 84 ++++++++++------------ 1 file changed, 36 insertions(+), 48 deletions(-) (limited to 'files/ja') diff --git a/files/ja/web/javascript/reference/operators/addition/index.md b/files/ja/web/javascript/reference/operators/addition/index.md index dc258fc3c1..fed9a4fa48 100644 --- a/files/ja/web/javascript/reference/operators/addition/index.md +++ b/files/ja/web/javascript/reference/operators/addition/index.md @@ -6,77 +6,65 @@ tags: - Language feature - Operator - Reference +browser-compat: javascript.operators.addition translation_of: Web/JavaScript/Reference/Operators/Addition --- -
{{jsSidebar("Operators")}}
+{{jsSidebar("Operators")}} -

加算演算子 (+) は、数値オペランドまたは文字列連結の合計を生成します。

+加算演算子 (`+`) は、数値オペランドの合計または文字列の連結を生成します。 -
{{EmbedInteractiveExample("pages/js/expressions-addition.html")}}
+{{EmbedInteractiveExample("pages/js/expressions-addition.html")}} -
+## 構文 +```js +x + y +``` +## 例 -

構文

+### 数値の加算 -
Operator: x + y
-
- -

- -

数値加算

- -
// 数値 + 数値 -> 加算
+```js
+// 数値 + 数値 -> 加算
 1 + 2 // 3
 
-// ブール値 + 数値 -> 加算
+// 論理値 + 数値 -> 加算
 true + 1 // 2
 
-// ブール値 + ブール値 -> 加算
+// 論理値 + 論理値 -> 加算
 false + false // 0
-
+``` -

文字列連結

+### 文字列の連結 -
// 文字列 + 文字列 -> 連結
+```js
+// 文字列 + 文字列 -> 連結
 'foo' + 'bar' // "foobar"
 
-// 数値 + 文字列 -> 連結
+// 数値 + 文字列 -> 連結
 5 + 'foo' // "5foo"
 
-// 文字列 + ブール値 -> 連結
-'foo' + false // "foofalse"
- -

仕様

- - - - - - - - - - -
仕様
{{SpecName('ESDraft', '#sec-addition-operator-plus', 'Addition operator')}}
+// 文字列 + 論理値 -> 連結 +'foo' + false // "foofalse" +``` -

ブラウザーの互換性

+## 仕様書 +{{Specifications}} +## ブラウザーの互換性 -

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

+{{Compat}} -

関連項目

+## 関連情報 - +- [減算演算子](/ja/docs/Web/JavaScript/Reference/Operators/Subtraction) +- [除算演算子](/ja/docs/Web/JavaScript/Reference/Operators/Division) +- [乗算演算子](/ja/docs/Web/JavaScript/Reference/Operators/Multiplication) +- [剰余演算子](/ja/docs/Web/JavaScript/Reference/Operators/Remainder) +- [べき乗演算子](/ja/docs/Web/JavaScript/Reference/Operators/Exponentiation) +- [インクリメント演算子](/ja/docs/Web/JavaScript/Reference/Operators/Increment) +- [デクリメント演算子](/ja/docs/Web/JavaScript/Reference/Operators/Decrement) +- [単項マイナス演算子](/ja/docs/Web/JavaScript/Reference/Operators/Unary_negation) +- [単項プラス演算子](/ja/docs/Web/JavaScript/Reference/Operators/Unary_plus) -- cgit v1.2.3-54-g00ecf