typeof-basic.js 321 B

123456789101112
  1. try {
  2. assert(typeof "foo" === "string");
  3. assert(!(typeof "foo" !== "string"));
  4. assert(typeof (1 + 2) === "number");
  5. assert(typeof {} === "object");
  6. assert(typeof null === "object");
  7. assert(typeof undefined === "undefined");
  8. console.log("PASS");
  9. } catch (e) {
  10. console.log("FAIL: " + e);
  11. }