I know a lot of ways to create JS objects but I didn\'t know the Object.create(null)\'s one.
Question:
is it exactly the same as:
They are not equivalent. {}.constructor.prototype == Object.prototype while Object.create(null) doesn't inherit from anything and thus has no properties at all.
In other words: A javascript object inherits from Object by default, unless you explicitly create it with null as its prototype, like: Object.create(null).
{} would instead be equivalent to Object.create(Object.prototype).
In Chrome Devtool you can see that Object.create(null) has no __proto__ property, while {} does.