What is the difference between `Object.getPrototypeOf(obj)` and `obj.__proto__`?

JavaScript Developer Hard

JavaScript Developer — Hard

What is the difference between `Object.getPrototypeOf(obj)` and `obj.__proto__`?

Key points

  • Object.getPrototypeOf() is the standard way to access an object's prototype
  • obj.__proto__ is deprecated and should not be used in production code
  • Using Object.getPrototypeOf() ensures consistency and reliability in your code

Ready to go further?

Related questions