1

I'm currently learning JavaScript from ECMA Manual, and I'm confused with the concept of built-in object. I know that object like Function, Object, Math are built-in objects, and you can use them directly, e.g, Math.PI. But how about var obj = new Function('return a'), Can I call obj a built-in object? Or is it just a plain native object (but not built-in)? Thanks!

Edit: Definition from ECMA

3
  • What is the difference between native and built-in for you? Either way, since you created obj, it's probably not a built-in object. It doesn't exist in another JS system. Commented Feb 19, 2015 at 16:16
  • Easy way to tell if its built in is if you log it and it returns "[native code]" in the function body, eg String returns function String() { [native code] } Commented Feb 19, 2015 at 16:26
  • I got it, thanks you guys for clarify this :) Commented Feb 19, 2015 at 16:28

1 Answer 1

3

4.3.7 built-in object

object supplied by an ECMAScript implementation, independent of the host environment, that is present at the start of the execution of an ECMAScript program

You create the object obj. That means it wasn't present at the start of the execution of the ECMAScript program. Therefore, it isn't a built-in object.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.