From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../reference/operators/subtraction/index.html | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 files/zh-cn/web/javascript/reference/operators/subtraction/index.html (limited to 'files/zh-cn/web/javascript/reference/operators/subtraction') diff --git a/files/zh-cn/web/javascript/reference/operators/subtraction/index.html b/files/zh-cn/web/javascript/reference/operators/subtraction/index.html new file mode 100644 index 0000000000..6bb33366e8 --- /dev/null +++ b/files/zh-cn/web/javascript/reference/operators/subtraction/index.html @@ -0,0 +1,67 @@ +--- +title: Subtraction (-) +slug: Web/JavaScript/Reference/Operators/Subtraction +translation_of: Web/JavaScript/Reference/Operators/Subtraction +--- +
{{jsSidebar("Operators")}}
+ +

The subtraction operator (-) subtracts the two operands, producing their difference.

+ +
{{EmbedInteractiveExample("pages/js/expressions-subtraction.html")}}
+ +
+ + + +

语法

+ +
Operator: x - y
+
+ +

Examples

+ +

Subtraction with numbers

+ +
5 - 3     // 2
+3 - 5     // -2
+ +

Subtraction with non-numbers

+ +
'foo' - 3 // NaN
+ +

Specifications

+ + + + + + + + + + +
Specification
{{SpecName('ESDraft', '#sec-subtraction-operator-minus', 'Subtraction operator')}}
+ +

Browser compatibility

+ + + +

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

+ +

See also

+ + + +

+ +

-- cgit v1.2.3-54-g00ecf