159k views
1 vote
In this case:

var a = 6, b = "ten";


if ( a < b || b < a ) {


alert("this is true!");


}


the alert will not be run. It seems that a

User Abhilasha
by
3.2k points

1 Answer

3 votes

Answer:

I'm sure that code is JS,

so the problem is you are using the < > operator with a number and a string. This is a comparison operator and wouldn't work with any other type than number

User Gilzero
by
3.4k points