1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:17:35 +00:00

LibJS: Implement unary plus / minus

This commit is contained in:
Linus Groh 2020-04-02 17:58:39 +01:00 committed by Andreas Kling
parent 5e6e1fd482
commit a62230770b
9 changed files with 73 additions and 25 deletions

View file

@ -2,7 +2,7 @@ function assert(x) { if (!x) throw 1; }
try {
assert(Math.abs('-1') === 1);
assert(Math.abs(0 - 2) === 2);
assert(Math.abs(-2) === 2);
assert(Math.abs(null) === 0);
assert(Math.abs('') === 0);
assert(Math.abs([]) === 0);