the question "1" = = 1 is asked during the interview, and this judgment condition will convert "1" to number type 1 when executed, but how to verify it? (do I want to pass code verification? Because I don"t know how to verify it, I game over). Once again, my IQ has been crushed.
if it is an object and {} = = 1, the object is converted to the original value, which can be verified by the valueOf method that defines the object,
{valueOf:()=>{console.log("test")}} ==1;
but as mentioned in the title, how do you verify that a string is converted to a number?