console.log(Object.prototype.hasOwnProperty('parseInt')); // false
console.log(Number.prototype.hasOwnProperty('parseInt')); // false
Where is parseInt defined if not on the default prototype object (Object.prototype), the prototype object from which all JS objects inherit?
Both
parseIntandparseFloatare native code, so they will depend on the implementation. Neither function has a prototype.Somewhere in this commit, there are some definitions for GlobalParseInt and GlobalParseFloat. If you have knowledge of C/natives, you could take a look and learn for yourself. As for Spidermonkey, Firefox's engine, I couldn't find an exact file but did find many references to the
parseIntfunction in this search.