From f1aac7edb4afc05c5e4011ca75f12b7f93e2a17e Mon Sep 17 00:00:00 2001 From: "Michael[tm] Smith" Date: Tue, 9 Mar 2021 16:30:04 +0900 Subject: [PATCH] =?UTF-8?q?Annotate=20notations=20in=20JS=20=E2=80=9CEqual?= =?UTF-8?q?ity=20comparisons=20and=20sameness=E2=80=9D=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equality_comparisons_and_sameness/index.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/files/en-us/web/javascript/equality_comparisons_and_sameness/index.html b/files/en-us/web/javascript/equality_comparisons_and_sameness/index.html index 725437f56cdbaf8..3e250bd64540b29 100644 --- a/files/en-us/web/javascript/equality_comparisons_and_sameness/index.html +++ b/files/en-us/web/javascript/equality_comparisons_and_sameness/index.html @@ -163,7 +163,13 @@

Loose equality using ==

-

In the above table, ToNumber(A) attempts to convert its argument to a number before comparison. Its behavior is equivalent to +A (the unary + operator). ToPrimitive(A) attempts to convert its object argument to a primitive value, by attempting to invoke varying sequences of A.toString and A.valueOf methods on A.

+

In the above table:

+

Traditionally, and according to ECMAScript, all objects are loosely unequal to undefined and null. But most browsers permit a very narrow class of objects (specifically, the document.all object for any page), in some contexts, to act as if they emulate the value undefined. Loose equality is one such context: null == A and undefined == A evaluate to true if, and only if, A is an object that emulates undefined. In all other cases an object is never loosely equal to undefined or null.