What does Object.create(null) produce compared to {}?

JavaScript Developer Medium

JavaScript Developer — Medium

What does Object.create(null) produce compared to {}?

Key points

  • Object.create(null) creates an object without a prototype chain
  • {} creates an object that inherits Object.prototype methods
  • Object.create(null) is useful for creating truly empty objects

Ready to go further?

Related questions