LoginSignup
0
0

More than 1 year has passed since last update.

85.hasOwnProperty〜プロパティがあるかどうかを調べる〜

Posted at

hasOwnPropatyとは

オブジェクトの中にOOというプロパティがないかを調べる→存在すればTRUE

Inとは

オブジェクトだけではなく、プロトタイプを含めてOOというプロパティがないかを調べる→存在すればTRUE

function Person(name, age) {
    this.name = name;
    this.age = age;
}

Object.prototype.hello = function() {
    console.log('Object: hello ' + this.name);
}

const bob = new Person('Bob', 18);
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0