El primer paso para ser un buen amigo con javascript

SOURCE 5977 palabras JavaScript

Problema

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
























Respuesta


¿Por qué?
var obj = {}
obj //=> {}
typeof obj //=> "object"
obj instanceof Object //=> true
var obj = Object.create(null)
obj //=> {}
typeof obj //=> "object"
obj instanceof Object //=> false