LoginSignup
0

More than 5 years have passed since last update.

[クイズ]javascriptと仲良くなるための一歩 第29話「nullでcreate2」

Posted at

問題

var obj = {}
obj //=> {}
typeof obj //=> "object"
obj instanceof Object //=> ?
var obj = Object.create(null)
obj //=> {}
typeof obj //=> "object"
obj instanceof Object //=> ?

:mouse:
:cow:
:tiger:
:rabbit:
:dragon_face:
:snake:
:horse:
:sheep:
:monkey_face:
:bird:
:dog:
:boar:
:mouse:
:cow:
:tiger:
:rabbit:
:dragon_face:
:snake:
:horse:
:sheep:
:monkey_face:
:bird:
:dog:
:boar:

答え

なんで?:hugging:

var obj = {}
obj //=> {}
typeof obj //=> "object"
obj instanceof Object //=> true
var obj = Object.create(null)
obj //=> {}
typeof obj //=> "object"
obj instanceof Object //=> false

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