最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Non-ECMAscript code for function - Stack Overflow

programmeradmin2浏览0评论

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 badges
Add a ment  | 

2 Answers 2

Reset to default 14

The 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++.

发布评论

评论列表(0)

  1. 暂无评论