let number = 5;
console.log(typeof number !== "number")
I do not understand why a variable with a number type is equal to a string
because the type of number (in this case 5) is "number".
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof
I do not understand why a variable with a number type is equal to a string
It's not the variable that is equal to a string, instead it is the type that is (equal to) a string!
The type of the variable 5 is "number" (as determined by typeof number) and "number" is a string.