I'm reading through the ECMA Script 2015 specification.
Under functions
I see:
In addition to its properties, a function contains executable code and state that determine how it behaves when invoked. A function’s code may or may not be written in ECMAScript (emphasis added).
Under what circumstances would a function's code not be written in ECMA script?
I'm reading through the ECMA Script 2015 specification.
Under functions
I see:
In addition to its properties, a function contains executable code and state that determine how it behaves when invoked. A function’s code may or may not be written in ECMAScript (emphasis added).
Under what circumstances would a function's code not be written in ECMA script?
Share Improve this question asked Sep 18, 2015 at 22:11 Allyl IsocyanateAllyl Isocyanate 13.6k17 gold badges84 silver badges132 bronze badges2 Answers
Reset to default 14The native functions provided by the execution environment (like the String
and Array
classes, or setTimeout
, or the browser DOM) are frequently written (or powered by other functions written) in C.
Under what circumstances would a function's code not be written in ECMA script?
Core functions provided by the JavaScript engine. E.g. Array.prototype.find
:
> Array.prototype.find
find() { [native code] }
For example V8, Chrome's JavaScript engine, is implement in C++, so that method is implemented in C++.