Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Non-ECMAscript code for function

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?

like image 675
Allyl Isocyanate Avatar asked Sep 18 '15 22:09

Allyl Isocyanate


People also ask

What does () => mean in JavaScript?

It's a new feature that introduced in ES6 and is called arrow function. The left part denotes the input of a function and the right part the output of that function.

What does function * mean in JavaScript?

The function* declaration ( function keyword followed by an asterisk) defines a generator function, which returns a Generator object.

Is JavaScript is ECMAScript?

JavaScript is a general-purpose scripting language that conforms to the ECMAScript specification. The ECMAScript specification is a blueprint for creating a scripting language. JavaScript is an implementation of that blueprint. On the whole, JavaScript implements the ECMAScript specification as described in ECMA-262.

What is ECMAScript in simple words?

ECMAScript, also known as JavaScript, is a programming language adopted by the European Computer Manufacturer's Association as a standard for performing computations in Web applications. ECMAScript is the official client-side scripting language of VoiceXML.


2 Answers

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.

like image 135
SLaks Avatar answered Sep 28 '22 11:09

SLaks


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

like image 22
Felix Kling Avatar answered Sep 28 '22 12:09

Felix Kling