javascriptarraysprototypeprototypal-inheritance

How can I access contents of the built-in Array, Object, String constructor functions


How can I open the underlying script of built-in functions like Array.prototype.map. I'm just really curious about what is inside. I tried to dig deep in the console but did't find anything. Constructor node doesn't have any content inside.


Solution

  • If you try to run javascript code in the Chrome console or Node.js console the code will be executed at the top of the v8 engine.

    And to see the source code of built-in functions and methods go to the public repo of v8 because it's open source : https://github.com/v8/v8

    on this page, if you ctrl + F "map" to search trough the page you will see the files where the map method is written !