graduate Posted January 23, 2012 Share Posted January 23, 2012 Why Object.toString !== Object.prototype.toString ?? Link to comment Share on other sites More sharing options...
justsomeguy Posted January 23, 2012 Share Posted January 23, 2012 Object is treated as a function, and Object.prototype is treated as an object. Object.toString();"function Object() { [native code] }"Object.prototype.toString();"[object Object]" Link to comment Share on other sites More sharing options...
Ingolme Posted January 23, 2012 Share Posted January 23, 2012 They're references to different methods.The first method, Object.toString() is a function that shows a string representation of Object() while Object.prototype.toString() is a method that all instances (copies) of Object() have. Normally, if you create your own object, you override the toString() method to make it show what you want it to. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.