1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00

LibJS: Add global isNaN() function

This commit is contained in:
Andreas Kling 2020-03-27 12:45:36 +01:00
parent 9a78b4af2c
commit 04ced9e24a
2 changed files with 9 additions and 0 deletions

View file

@ -3,6 +3,10 @@ function assert(x) { if (!x) throw 1; }
try {
var nan = undefined + 1;
assert(nan + "" == "NaN");
assert(isNaN(nan) === true);
assert(isNaN(0) === false);
assert(isNaN(undefined) === false);
assert(isNaN(null) === false);
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);