Answer the question
In order to leave comments, you need to log in
JavaScript Type Casting: Why does 99 > 'string' convert to false?
It seems that the data should be converted to a number:
99 > 'string'
99 > NaN
99 > 0
true
But the code for testing the hypothesis returns false
if (99 > 'строка'){
console.log('True');
} else{
console.log('False')
}
Answer the question
In order to leave comments, you need to log in
// parseInt('string') is NaN
// 99 > NaN is false
NaN === NaN // is false
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question