Object.prototype.hasOwnProperty.js 243 B

1234567891011
  1. function assert(x) { if (!x) throw 1; }
  2. try {
  3. var o = {};
  4. o.foo = 1;
  5. assert(o.hasOwnProperty("foo") === true);
  6. assert(o.hasOwnProperty("bar") === false);
  7. console.log("PASS");
  8. } catch (e) {
  9. console.log("FAIL: " + e);
  10. }