aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/javascript/reference/operators/unary_negation
diff options
context:
space:
mode:
authorMasahiro FUJIMOTO <mfujimot@gmail.com>2021-09-27 00:13:24 +0900
committerMasahiro FUJIMOTO <mfujimot@gmail.com>2021-10-08 02:02:05 +0900
commitd7d93e38e741f18410427e2831c1306cd3760138 (patch)
treec0f41ed5c388292f35259d64b179ee111bd1f7f0 /files/ja/web/javascript/reference/operators/unary_negation
parent4ba2fc11c3ad0140b7628aa78fef27c58b8aab94 (diff)
downloadtranslated-content-d7d93e38e741f18410427e2831c1306cd3760138.tar.gz
translated-content-d7d93e38e741f18410427e2831c1306cd3760138.tar.bz2
translated-content-d7d93e38e741f18410427e2831c1306cd3760138.zip
単項プラス、単項マイナスの記事を更新
- 2021/07/21 時点の英語版に同期
Diffstat (limited to 'files/ja/web/javascript/reference/operators/unary_negation')
-rw-r--r--files/ja/web/javascript/reference/operators/unary_negation/index.md93
1 files changed, 40 insertions, 53 deletions
diff --git a/files/ja/web/javascript/reference/operators/unary_negation/index.md b/files/ja/web/javascript/reference/operators/unary_negation/index.md
index 0a7fe27e04..562ee6dc0f 100644
--- a/files/ja/web/javascript/reference/operators/unary_negation/index.md
+++ b/files/ja/web/javascript/reference/operators/unary_negation/index.md
@@ -3,76 +3,63 @@ title: 単項マイナス (-)
slug: Web/JavaScript/Reference/Operators/Unary_negation
tags:
- JavaScript
- - Language feature
- - Operator
- - Reference
- - 演算子
- 言語機能
+ - 演算子
+ - Reference
+browser-compat: javascript.operators.unary_negation
translation_of: Web/JavaScript/Reference/Operators/Unary_negation
---
-<div>{{jsSidebar("Operators")}}</div>
-
-<p>単項マイナス演算子 (<code>-</code>) はオペランドの前に置かれ、符号を反転します。</p>
+{{jsSidebar("Operators")}}
-<div>{{EmbedInteractiveExample("pages/js/expressions-unary-negation.html")}}</div>
+単項マイナス演算子 (`-`) はオペランドの前に置かれ、符号を反転します。
-<div class="hidden">このデモのソースファイルは GitHub リポジトリに格納されています。デモプロジェクトに協力したい場合は、 <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> をクローンしてプルリクエストを送信してください。</div>
+{{EmbedInteractiveExample("pages/js/expressions-unary-negation.html")}}
-<h2 id="Syntax" name="Syntax">構文</h2>
+## 構文
-<pre class="syntaxbox notranslate"><strong>演算子:</strong> -<var>x</var>
-</pre>
+```js
+-x
+```
-<h2 id="Examples" name="Examples">例</h2>
+## 例
-<h3 id="Negating_numbers" name="Negating_numbers">数値の符号を反転</h3>
+### 数値の符号を反転
-<pre class="brush: js notranslate">const x = 3;
+```js
+const x = 3;
const y = -x;
// y = -3
// x = 3
-</pre>
+```
-<h3 id="Negating_non-numbers" name="Negating_non-numbers">数値以外の符号を反転</h3>
+### 数値以外の符号を反転
-<p>単項マイナス演算子は、数値でないものを数値に変換することができます。</p>
+単項マイナス演算子は、数値でないものを数値に変換することができます。
-<pre class="brush: js notranslate">const x = "4";
+```js
+const x = "4";
const y = -x;
// y = -4
-</pre>
-
-<h2 id="Specifications" name="Specifications">仕様書</h2>
-
-<table class="standard-table">
- <thead>
- <tr>
- <th scope="col">仕様書</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>{{SpecName('ESDraft', '#sec-unary-minus-operator', 'Unary negation operator')}}</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
-
-<p>{{Compat("javascript.operators.unary_negation")}}</p>
-
-<h2 id="See_also" name="See_also">関連情報</h2>
-
-<ul>
- <li><a href="/ja/docs/Web/JavaScript/Reference/Operators/Addition">加算演算子</a></li>
- <li><a href="/ja/docs/Web/JavaScript/Reference/Operators/Subtraction">減算演算子</a></li>
- <li><a href="/ja/docs/Web/JavaScript/Reference/Operators/Division">除算演算子</a></li>
- <li><a href="/ja/docs/Web/JavaScript/Reference/Operators/Multiplication">乗算演算子</a></li>
- <li><a href="/ja/docs/Web/JavaScript/Reference/Operators/Remainder">剰余演算子</a></li>
- <li><a href="/ja/docs/Web/JavaScript/Reference/Operators/Exponentiation">べき乗演算子</a></li>
- <li><a href="/ja/docs/Web/JavaScript/Reference/Operators/Increment">インクリメント演算子</a></li>
- <li><a href="/ja/docs/Web/JavaScript/Reference/Operators/Decrement">デクリメント演算子</a></li>
- <li><a href="/ja/docs/Web/JavaScript/Reference/Operators/Unary_plus">単項プラス演算子</a></li>
-</ul>
+```
+
+## 仕様書
+
+{{Specifications}}
+
+## ブラウザーの互換性
+
+{{Compat}}
+
+## 関連情報
+
+- [加算演算子](/ja/docs/Web/JavaScript/Reference/Operators/Addition)
+- [減算演算子](/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_plus)