3 ms·
JS does not have an Integer type, so (x > 0) does not work It depends on what the surrounding code actually does wheter (x > 0) works or not. Depending on the
by EdiX 11y ago
JS does not have an Integer type, so (x > 0) does not work
It depends on what the surrounding code actually does wheter (x > 0) works or not. Depending on the version of is-positive-integer you are using a positive instance of the class Number may return true, false or cause an error.
PS. never mind that the implementation of is-positive-integer is extremely inefficient.