Your job is to write a function or program that detects if a number
a is less than a number
But... You are not allowed to use built-in alternatives for equals, less than, greater than, less than or equal to, greater than or equal to, or not equal to operators. (Writing your own implementation is allowed.) Similar alternative methods/alternatives in other languages that are designed to replace those operations are also restricted.
You are allowed to use operators that are not banned, e.g. bitwise operators and the not operator (but it would be better if your answer did not have the not operator).
Simply return a truthy or falsy value (or something that evaluates in the language to true or false like 0 or 1) to indicate whether
a is less than
b. The winner of the challenge can be determined by the shortest code. External sources are not allowed, but anonymous functions are. Explaining your answer is not mandatory, but encouraged.
(a,b)=>!!Math.max(0,b-a) //remove the !! for truthy and falsy numbers /*Explanation (a,b) Parameters a and b => Function is !! returns true if truthy and false if falsy Math.max(0,b-a) returns the greater number, 0 or b-a */
Examples of Input and Output
Input | Output ------|------- 1, 3 | true 2, 2 | false 3, 2 | false