From 01b0e12ba27b5069248fd09235e9a7143915ee30 Mon Sep 17 00:00:00 2001 From: Irvin Date: Wed, 16 Feb 2022 02:02:49 +0800 Subject: remove `notranslate` class in zh-CN --- .../web/javascript/reference/operators/equality/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/operators/equality') diff --git a/files/zh-cn/web/javascript/reference/operators/equality/index.html b/files/zh-cn/web/javascript/reference/operators/equality/index.html index fadd413b17..5ea543e057 100644 --- a/files/zh-cn/web/javascript/reference/operators/equality/index.html +++ b/files/zh-cn/web/javascript/reference/operators/equality/index.html @@ -15,7 +15,7 @@ original_slug: Web/JavaScript/Reference/Operators/相等

语法

-
x == y
+
x == y
 

描述

@@ -52,12 +52,12 @@ original_slug: Web/JavaScript/Reference/Operators/相等

没有类型转换的比较

-
1 == 1;              // true
+
1 == 1;              // true
 "hello" == "hello";  // true

与类型转换比较

-
"1" ==  1;            // true
+
"1" ==  1;            // true
 1 == "1";             // true
 0 == false;           // true
 0 == null;            // false
@@ -71,7 +71,7 @@ number1 == number2;   // false

对象比较

-
const object1 = {"key": "value"}
+
const object1 = {"key": "value"}
 const object2 = {"key": "value"};
 
 object1 == object2 // false
@@ -81,7 +81,7 @@ object2 == object2 // true

请注意,使用构造的字符串new String()是对象。如果将其中之一与字符串文字进行比较,则该String对象将被转换为字符串文字并对其内容进行比较。但是,如果两个操作数都是String对象,则将它们作为对象进行比较,并且必须引用相同的对象才能进行比较:

-
const string1 = "hello";
+
const string1 = "hello";
 const string2 = String("hello");
 const string3 = new String("hello");
 const string4 = new String("hello");
@@ -94,7 +94,7 @@ console.log(string4 == string4); // true

比较日期和字符串

-
const d = new Date('December 17, 1995 03:24:00');
+
const d = new Date('December 17, 1995 03:24:00');
 const s = d.toString(); // for example: "Sun Dec 17 1995 03:24:00 GMT-0800 (Pacific Standard Time)"
 console.log(d == s);    //true
-- cgit v1.2.3-54-g00ecf