According to the ECMA-262 a native object
object in an ECMAScript implementation whose semantics are fully defined by this specification rather than by the host environment
A built-in object is defined as
object supplied by an ECMAScript implementation, independent of the host environment, that is present at the start of the execution of an ECMAScript program.
with a note
Standard built-in objects are defined in this specification, and an ECMAScript implementation may specify and define others. Every built-in object is a native object.
If a native object is fully defined by the ECMA-262 specification rather than the host environment and an ECMAScript implementation may specify and define new built-in objects, how is it that these new built-in object's can be native objects when they are not fully defined by the ECMA-262 specification?
What am I missing?
They're "native" because they come with the ECMAScript implementation. A host environment in generally an application consisting of an ECMAScript implementation and several other interfaces that work together. For instance,
"Built-in" objects are required to inherit from Object
or Function
, whereas host objects — objects provided by the host environment, but not necessarily present at the start of execution — are not required to but may (and sometimes do).
Object()
, Array()
, Date()
Math
, JSON
, the Global object.WeakMap()
or __proto__
ActiveXObject()
constructor and (undocumented) CollectGarbage()
function document
and window
console
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With