0

Whenever I try to look at JavaScript method definitions like Math.max() for example, I'll usually end up in a .d.ts file and I don't know where to go from there to view the actual method implementation.

Is there a way to inspect the source inside the JS v8 engine?

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
  • 2
    You've take a look at JS engine's source code to view the actual implementation. – Teemu Mar 02 '20 at 09:54
  • There is no such thing as JS source code as JS runs via some engine like V8 which is written in C++, but as Teemu said, you can read the C++ implementation and see what it does – Mark Shulhin Mar 02 '20 at 10:25
  • Thanks for clarifying @mark-shulhin. I will update the question – Deschant Kounou Mar 02 '20 at 17:47
  • 1
    No, editors are not capable to show the compiled source code of the native implementations. If you want to see such an implementation, you have go to online, some JS engines are open source projects, search for the source and you'll find the method implementation. – Teemu Mar 03 '20 at 20:10

0 Answers0