Javascript implicit type conversion steps
Here, implicit type conversion is a conversion caused by =. If NaN exists, return false and check whether there are any Boolean values. If there is a Boolean value, convert the Boolean value to a number and check whether there are any strings. In three cases, the opposite object is an object and the object is converted using toString; the opposite party is a number, the string is converted to a number, the other party is a string, direct comparison; other returns false if a number, the other party is an object, the object is valueOf for comparison, and other returns falsenull, undefined does not perform type conversion, but they must be in the same order, which is frequently asked during interviews. Below are some miscellaneous. Do it yourself 0 = undefined 1 = true 2 = {valueOf: function () {return 2} NaN = NaN 8 = undefined 1 = undefined null = {toString: function () {return 2} 0 = null = 1 {toString: function () {return 1}, valueOf: function () {return [] }== 1