Someone told me that there's !< and !> in JavaScript. I tried it but it didn't work. Is there something like this in JavaScript? If not in JavaScript, is it there in any other language?
2 Answers
No. In JavaScript and many other languages (for numbers - not NaN - and strings):
"!<" is >=
"!>" is <=
Check this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators
5 Comments
zerkms
Not all values are transitive to
> and <=: NaN > 5 // false, NaN <= 5 // false. So technically not > is not <= in js typesystem.Alberto Trindade Tavares
That's true. I edited my answer to clarify that is for numbers and strings only (which probable is his case)
zerkms
NaN is a number.Alberto Trindade Tavares
Well, technically... okay, added a clarification wrt this =p
Mohammed Shoaib
Thank you all for your help! :)
(!(something > something))and vice-versa.