0
Is it possible to know the code inside predefined method?
Is it possible to know the code of predefined methods or for example, what is the code of document.write()? What is the code inside document object, and what is the code inside write method? Any website where I can see the code inside them? It's just a library i think? Is it possible to see them as we can see bootstrap?
5 Answers
+ 2
U can see on mdn website
For example foreach
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
0
Beauty thanks for suggesting, but I already try mdn, and found nothing. What I mean is,
function getElementById(?,?,?,?){
??????
???????
????
??????
};
#---------or---------
function write(?,?,?){
?????
????
};
function document(?,?,?,?) {
??????
??????
this.write = write;
this.takingElemntById = getElementById;
};
What are the codes inside those predefined keywords, function, method, or object?
such as
Math.PI
alert ()
documentation.write()
document.getElementById()
0
Is it not possible to know the code inside those predefined?
0
Jonathan P. Jundarino MDN provide u Array.prototype and Object.prototype predefined method
0
Yes, it is possible to know the native code of js and the browser but it depends on if the code is open source. Chrome is open source, in the form of Chromium. You can check the other browsers and js engines for yourself.
https://source.chromium.org/
Links to source code:
document.getElementById:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/external/wpt/dom/nodes/Document-getElementById.html;l=34?q=document.getElementBy
Array.forEach:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/google_input_tools/third_party/closure_library/closure/goog/array/array.js;l=197q=array.forEach&ss=chromium%2Fchromium%2Fsrc