0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

javaScript67_prototype属性

Posted at

hasOwnPropertyの使い方:
image.png

prototypeオブジェクトもオブジェクトです。そのため、指向先のオブジェクトがあります。
属性あるいは方法にアクセスする時、下記の手順になります。
自分の中で探す、自分の中になければ、prototypeのオブジェクトで探す。prototypeオブジェクトの中にもなかれば、prototypeオブジェクトのオブジェクトで探す。
そちらもなければ、undefinedを返す。
image.png

コードで書くと、こんな感じです。
image.png

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?