🌈 strict equality “===” will not be cast when comparing, whereas equality “==” will be cast as long as the two values are equal.

🌈 The comparison of reference types is a reference comparison, not a value comparison. Even if two identical functions and objects have different references, the result will be false

eg1:

Let a = [1, 2, 3]; Let b = [1, 2, 3]; a==b //falseCopy the code

eg2:

var objA = { a: 1, b: 2, b: 3 }; var objB = { a: 1, b: 2, b: 3 }; objA == objB; //=>false, array arrA and array arrB are not equalCopy the code

🌈null and undefined are equal, but not strictly equal

🌈NaN is not equal to any value, including itself.

NaN == NaN //false
Copy the code

🌈 about type conversion in equality

⭐ If one value is a number and the other is a string, the string is converted to a number and the converted value is used for comparison. ⭐ If one of the values is true, it is converted to 1 for comparison. If one of the values is false, it is converted to 0 for comparison. ⭐ If one of the values is an object and the other is a number or string, the object is converted to its original value by conversion rules and then compared. The object is converted to its original value by the toString() or valueOf() methods. The built-in classes at the heart of the JavaScript language first try to use valueOf() and then toString(), except for the date class, which only uses toString() conversions.