var result='16'>'141';
console.log(result);
var result='16'>141;
console.log(result);
That’s because if any of the operands is not string, then both operands become numbers, and the comparison becomes correct.
Can anyone tell me. How below equation is evaluate?
var result='a'>11;
console.log(result);
'a'>11=> Answer should be true instead of false;
because
'a' will convert to int 97 > 11 => true then how it evaluate false.
If I go like this 'a'>'11' => then it answer comes true.
var result='a'>'11';
console.log(result);
Number('a')will beNaNandNaNis never equals to anything including itself..