I see this code in underscore.js.
Here it is, with the alias applied:
toString = ObjProto.toString,
However, to use toString it is also accessible directly like this, w/ out using above code at all.
Try it out in the console it works fine. Try it out in direct code and it works fine as well. My guess is that older browsers may not have it accessible in this way.
How can I look into this further?
Caniuse does not not have information on it.
Google pulls up nothing useful in the first 10 or so hits.
Because it is on
Object.prototype, it is accessible by global objects which inherit from Object ( only those that inherit, not all global objects ), such as Number.
But my point is, is that it is also accessible directly with out having to use a global object instance at all.
Here is one SO Q/A which suggests that window.toString is not supported in all browsers and why this is.