!=undefined / !=null

Benchmark created by kay on


Test runner

Ready to run.

Testing in
TestOps/sec
!=null
var n;
if (n != null && n !== null) {
  throw "fail";
} else {
  n = 8;
}
if (n != null && n !== null) {
  return 1;
} else {
  throw "fail";
}
ready
!=undefined
var n;
if (n != undefined) {
  throw "fail";
} else {
  n = 8;
}
if (n != undefined) {
  return 1;
} else {
  throw "fail";
}
ready
typeof==
var n;
if (typeof n != "undefined") {
  throw "fail";
} else {
  n = 8;
}
if (typeof n != "undefined") {
  return 1;
} else {
  throw "fail";
}
ready
typeof===
var n;
if (typeof n !== "undefined") {
  throw "fail";
} else {
  n = 8;
}
if (typeof n !== "undefined") {
  return 1;
} else {
  throw "fail";
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.