Is there any way to see the native code of javascript build-in functions in browser console so I can Know the algorithm efficiency of the function and how it actually works
-
1cs.chromium.org chromium codesumeet kumar– sumeet kumar2017-11-22 19:34:22 +00:00Commented Nov 22, 2017 at 19:34
-
1Check here developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…Vipin Kumar– Vipin Kumar2017-11-22 19:48:42 +00:00Commented Nov 22, 2017 at 19:48
-
1@VipinKumar is the source code is written in c++ languageOghli– Oghli2017-11-22 19:59:05 +00:00Commented Nov 22, 2017 at 19:59
Add a comment
|
1 Answer
- Ensure you are using an open source browser (or get a job where you get access to the source code of the browser you are using)
- Look through that source code of that browser
Native code is program source code that has been compiled to native machine code. The source code isn't on your system unless you get it from some other source. It certainly isn't available to JavaScript.
2 Comments
Oghli
Thanks for info. Are they coded up functions native code in C or C++ also why not in javascript ?
vox
Any native code is generally going to be in C/C++ or some other systems language for the simple reason of performance. At a theoretical level, interpreted languages must, at some point, be executed via a compiled language. JavaScript can technically be compiled, but is generally interpreted for safety reasons (though some engines compile certain portions that are considered safe).
