I want to write a series of JavaScript related articles/tutorials. I was looking up the ECMA specification when I discovered this interesting paragraph.
As ECMA-262 (Version 6) states:
4.3.7 exotic object
object that does not have the default behaviour for one or more of the essential internal methods that must be supported by all objects
NOTE Any object that is not an ordinary object is an exotic object.
Now I am curious. Are such exotic objects to be found in modern browser's JavaScript?
If so: Could one give me an example and tell in how far its behaviour is different from 'ordinary objects'?
A possible example:
The instance objects created by Array are exotic (a term used by the ECMAScript specification for objects that have features that normal objects don’t have): Their property length tracks and influences the management of array elements. In general, exotic objects can be created from scratch, but you can’t convert an existing normal object into an exotic one.
Taken from http://www.2ality.com/2015/02/es6-classes-final.html
There's also a list later in the spec including Array, String, and so on.
They're not "exotic" in the sense of mysterious and/or sexy.
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