0
{}.toString === Object.toString

This will return a false value while

{}.toString === Object.prototype.toString

is true.

we know that {} is a object literal , is it the same as new Object does? if this two things is equal,{}.toString and Object.toString should be the same, right?

Ryan Yiada
  • 4,739
  • 4
  • 18
  • 20
  • 1
    possible duplicate of [different between Object.toString and Object.prototype.toString](http://stackoverflow.com/questions/26333923/different-between-object-tostring-and-object-prototype-tostring) – Nagaraj Tantri Oct 14 '14 at 08:58
  • When you access `Object.toString`, you are accessing the method to convert the `Object` **constructor** to a string. When you access `Object.prototype.toString`, you are accessing the **function that will be given to each object**. `{}.toString` is **inherited from `Object.prototype`**, thus being the same. – Ismael Miguel Oct 14 '14 at 09:11

0 Answers0