4

For instance, open up a JS console, and type toString<Enter>.

You'll get this:

function toString() { [native code] }

Contrast this with:

function foo() { return 'bar'; }
foo

which produces:

function foo() { return 'bar'; }

Does it mean that its an API to the interpreter which directly executes some internal routines in C or whatever is used to program it when that method is called?

asked Sep 5, 2012 at 16:42
2

1 Answer 1

5

[native code] is simply a label that indicates that the implementation details of the function body are handled "natively" by the browser.

answered Sep 5, 2012 at 16:44
Sign up to request clarification or add additional context in comments.

1 Comment

So in practice that would typically mean either something akin to the "shadow DOM" or compiled binary code?

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.