In JavaScript, equality operators in JavaScript are classified into abstract equality and strict equality. What are their differences. Before describing a specific algorithm, we should first mention the JS data type. JS data types are divided into six categories: Undefined Null String Number Boolean Object. here, we use Type (x) to represent the Data Type 1 of x, and the process of abstracting equal = x = y is as follows: 1, Type (x) and Type (y) same: If Type (x) is Undefined or Null, true is returned, I .e.: undefined = undefined; null = null returns true if Type (x) is Number, if x or y is NaN, false is returned, that is, NaN = NaN is false; x and y are equal, or-0 and + 0 both return true, otherwise, false is returned. If Type (x) is String, true is returned only when the characters at the positions of x and y are identical. Otherwise, false is returned. If Type (x) is Boolean, true is returned for the same value. Otherwise, false. If Type (x) is an Object True is returned for the same reference. Otherwise, false is returned. For example: var a = {m: 1} var B = {m: 1} a = B. The result is false because, B is not the same reference. Let's look at var a = {m: 1} B = a = B. The result is true because they reference the same object 2, Type (x) is Undefined, Type (y) is Null, return true, that is, undefined = null is true 3, Type (x) is String, Type (y) is Number, convert x to Number, and then compare. For example: 1 = "1", the result is true, because after "1" is converted to Number, it is 1 4, Type (x) if it is Boolean and Type (y) is Number, convert x to Number for comparison. For example, true = 1; false = 0; true 5, Type (x) string or Number, Type (y) is Object, convert y to basic value, Example: 1 = new String ("1") "2" = new Number (2) results in true 6, returns false2, strictly equal = 1, if the result of Type (x) and Type (y) is inconsistent, false is returned, that is, if the Type is different, false is returned. For example: 1 = "1" false undefined = null false2, if Type (x) is Number, if x or y is NaN, false is returned, that is: naN = NaN: false; returns true if x and y are equal or if-0 and + 0 are both equal; otherwise, returns false3. If Type (x) is Undefined, returns true. If the result of Type (x) is Null, returns true. If Type (x) is String, returns true only when the characters at the corresponding positions of x and y are identical, otherwise, false is returned. If Type (x) is Boolean, true is returned for the same value. Otherwise, false is returned. If Type (x) is an Object, true is returned for the same reference. Otherwise, false is summed up. The difference between strict equality and abstraction is that strict equality first requires the same Type, during the comparison process, no type conversion is performed, and the comparison object type is converted to the same type before being compared.