The Object constructor :
extends
clause of a class definition.This function performs the following steps when called:
The Object constructor :
This function copies the values of all of the enumerable own properties from one or more source objects to a target object.
It performs the following steps when called:
The "length" property of this function is 2 𝔽.
20.1.2.2 Object.create ( O, Properties )This function creates a new object with a specified prototype.
It performs the following steps when called:
This function adds own properties and/or updates the attributes of existing own properties of an object.
It performs the following steps when called:
The abstract operation ObjectDefineProperties takes arguments O (an Object) and Properties (an ECMAScript language value ) and returns either a normal completion containing an Object or a throw completion . It performs the following steps when called:
This function adds an own property and/or updates the attributes of an existing own property of an object.
It performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
The function created for adder is never directly accessible to ECMAScript code.
20.1.2.8 Object.getOwnPropertyDescriptor ( O, P )This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
The abstract operation GetOwnPropertyKeys takes arguments O (an ECMAScript language value ) and type ( string or symbol ) and returns either a normal completion containing a List of property keys or a throw completion . It performs the following steps when called:
This function performs the following steps when called:
callback should be a function that accepts two arguments. groupBy
calls callback once for each element in items, in ascending order, and constructs a new object. Each value returned by callback is coerced to a property key . For each such property key , the result object has a property whose key is that property key and whose value is an array containing all the elements for which the callback return value coerced to that key.
callback is called with two arguments: the value of the element and the index of the element.
The return value of groupBy
is an object that does not inherit from %Object.prototype% .
This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
The initial value of Object.prototype
is the Object prototype object .
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.1.2.22 Object.seal ( O )This function performs the following steps when called:
This function performs the following steps when called:
This function performs the following steps when called:
The Object prototype object:
The initial value of Object.prototype.constructor
is %Object% .
This method performs the following steps when called:
The ordering of steps 1 and 2 is chosen to ensure that any exception that would have been thrown by step 1 in previous editions of this specification will continue to be thrown even if the this value is undefined or null .
20.1.3.3 Object.prototype.isPrototypeOf ( V )This method performs the following steps when called:
The ordering of steps 1 and 2 preserves the behaviour specified by previous editions of this specification for the case where V is not an object and the this value is undefined or null .
20.1.3.4 Object.prototype.propertyIsEnumerable ( V )This method performs the following steps when called:
This method does not consider objects in the prototype chain.
Note 2The ordering of steps 1 and 2 is chosen to ensure that any exception that would have been thrown by step 1 in previous editions of this specification will continue to be thrown even if the this value is undefined or null .
20.1.3.5 Object.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] )This method performs the following steps when called:
The optional parameters to this method are not used but are intended to correspond to the parameter pattern used by ECMA-402 toLocaleString
methods. Implementations that do not include ECMA-402 support must not use those parameter positions for other purposes.
This method provides a generic toLocaleString
implementation for objects that have no locale-sensitive toString
behaviour. Array
, Number
, Date
, and %TypedArray% provide their own locale-sensitive toLocaleString
methods.
ECMA-402 intentionally does not provide an alternative to this default implementation.
20.1.3.6 Object.prototype.toString ( )This method performs the following steps when called:
Historically, this method was occasionally used to access the String value of the [[Class]] internal slot that was used in previous editions of this specification as a nominal type tag for various built-in objects. The above definition of toString
preserves compatibility for legacy code that uses toString
as a test for those specific kinds of built-in objects. It does not provide a reliable type testing mechanism for other kinds of built-in or program defined objects. In addition, programs can use %Symbol.toStringTag% in ways that will invalidate the reliability of such legacy type tests.
This method performs the following steps when called:
Object.prototype.__proto__
is an accessor property with attributes { [[Enumerable]]: false , [[Configurable]]: true }. The [[Get]] and [[Set]] attributes are defined as follows:
The value of the [[Get]] attribute is a built-in function that requires no arguments. It performs the following steps when called:
The value of the [[Set]] attribute is a built-in function that takes an argument proto. It performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
This method performs the following steps when called:
Object instances have no special properties beyond those inherited from the Object prototype object .
20.2 Function Objects 20.2.1 The Function ConstructorThe Function constructor :
Function(…)
is equivalent to the object creation expression new Function(…)
with the same arguments.extends
clause of a class definition. Subclass constructors that intend to inherit the specified Function behaviour must include a super
call to the Function constructor to create and initialize a subclass instance with the internal slots necessary for built-in function behaviour. All ECMAScript syntactic forms for defining function objects create instances of Function. There is no syntactic means to create instances of Function subclasses except for the built-in GeneratorFunction, AsyncFunction, and AsyncGeneratorFunction subclasses.The last argument (if any) specifies the body (executable code) of a function; any preceding arguments specify formal parameters.
This function performs the following steps when called:
It is permissible but not necessary to have one argument for each formal parameter to be specified. For example, all three of the following expressions produce the same result:
new Function("a", "b", "c", "return a+b+c")
new Function("a, b, c", "return a+b+c")
new Function("a,b", "c", "return a+b+c")
20.2.1.1.1 CreateDynamicFunction ( constructor, newTarget, kind, parameterArgs, bodyArg )
The abstract operation CreateDynamicFunction takes arguments constructor (a constructor ), newTarget (a constructor or undefined ), kind ( normal , generator , async , or async-generator ), parameterArgs (a List of ECMAScript language values ), and bodyArg (an ECMAScript language value ) and returns either a normal completion containing an ECMAScript function object or a throw completion . constructor is the constructor function that is performing this action. newTarget is the constructor that new
was initially applied to. parameterArgs and bodyArg reflect the argument values that were passed to constructor. It performs the following steps when called:
new Function("/*", "*/ ) {")
does not evaluate to a function.CreateDynamicFunction defines a "prototype" property on any function it creates whose kind is not async to provide for the possibility that the function will be used as a constructor .
20.2.2 Properties of the Function ConstructorThe Function constructor :
The value of Function.prototype
is the Function prototype object .
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.2.3 Properties of the Function Prototype ObjectThe Function prototype object:
new
operator.The Function prototype object is specified to be a function object to ensure compatibility with ECMAScript code that was created prior to the ECMAScript 2015 specification.
20.2.3.1 Function.prototype.apply ( thisArg, argArray )This method performs the following steps when called:
The thisArg value is passed without modification as the this value. This is a change from Edition 3, where an undefined or null thisArg is replaced with the global object and ToObject is applied to all other values and that result is passed as the this value. Even though the thisArg is passed without modification, non-strict functions still perform these transformations upon entry to the function.
Note 2If func is either an arrow function or a bound function exotic object , then the thisArg will be ignored by the function [[Call]] in step 6 .
20.2.3.2 Function.prototype.bind ( thisArg, ...args )This method performs the following steps when called:
Function objects created using Function.prototype.bind
are exotic objects . They also do not have a "prototype" property.
If Target is either an arrow function or a bound function exotic object , then the thisArg passed to this method will not be used by subsequent calls to F.
20.2.3.3 Function.prototype.call ( thisArg, ...args )This method performs the following steps when called:
The thisArg value is passed without modification as the this value. This is a change from Edition 3, where an undefined or null thisArg is replaced with the global object and ToObject is applied to all other values and that result is passed as the this value. Even though the thisArg is passed without modification, non-strict functions still perform these transformations upon entry to the function.
Note 2If func is either an arrow function or a bound function exotic object , then the thisArg will be ignored by the function [[Call]] in step 4 .
20.2.3.4 Function.prototype.constructorThe initial value of Function.prototype.constructor
is %Function% .
This method performs the following steps when called:
This method performs the following steps when called:
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
NoteThis is the default implementation of %Symbol.hasInstance%
that most functions inherit. %Symbol.hasInstance%
is called by the instanceof
operator to determine whether a value is an instance of a specific constructor . An expression such as
v instanceof F
evaluates as
F[%Symbol.hasInstance%](v)
A constructor function can control which objects are recognized as its instances by instanceof
by exposing a different %Symbol.hasInstance%
method on the function.
This property is non-writable and non-configurable to prevent tampering that could be used to globally expose the target function of a bound function.
The value of the "name" property of this method is "[Symbol.hasInstance]" .
20.2.4 Function InstancesEvery Function instance is an ECMAScript function object and has the internal slots listed in Table 30 . Function objects created using the Function.prototype.bind
method ( 20.2.3.2 ) have the internal slots listed in Table 31 .
Function instances have the following properties:
20.2.4.1 lengthThe value of the "length" property is an integral Number that indicates the typical number of arguments expected by the function. However, the language permits the function to be invoked with some other number of arguments. The behaviour of a function when invoked on a number of arguments other than the number specified by its "length" property depends on the function. This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: true }.
20.2.4.2 nameThe value of the "name" property is a String that is descriptive of the function. The name has no semantic significance but is typically a variable or property name that is used to refer to the function at its point of definition in ECMAScript source text . This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: true }.
Anonymous functions objects that do not have a contextual name associated with them by this specification use the empty String as the value of the "name" property.
20.2.4.3 prototypeFunction instances that can be used as a constructor have a "prototype" property. Whenever such a Function instance is created another ordinary object is also created and is the initial value of the function's "prototype" property. Unless otherwise specified, the value of the "prototype" property is used to initialize the [[Prototype]] internal slot of the object created when that function is invoked as a constructor .
This property has the attributes { [[Writable]]: true , [[Enumerable]]: false , [[Configurable]]: false }.
NoteFunction objects created using Function.prototype.bind
, or by evaluating a MethodDefinition (that is not a GeneratorMethod or AsyncGeneratorMethod ) or an ArrowFunction do not have a "prototype" property.
The host-defined abstract operation HostHasSourceTextAvailable takes argument func (a function object ) and returns a Boolean. It allows host environments to prevent the source text from being provided for func.
An implementation of HostHasSourceTextAvailable must conform to the following requirements:
The default implementation of HostHasSourceTextAvailable is to return true .
20.3 Boolean Objects 20.3.1 The Boolean ConstructorThe Boolean constructor :
extends
clause of a class definition. Subclass constructors that intend to inherit the specified Boolean behaviour must include a super
call to the Boolean constructor to create and initialize the subclass instance with a [[BooleanData]] internal slot.This function performs the following steps when called:
The Boolean constructor :
The initial value of Boolean.prototype
is the Boolean prototype object .
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.3.3 Properties of the Boolean Prototype ObjectThe Boolean prototype object:
The initial value of Boolean.prototype.constructor
is %Boolean% .
This method performs the following steps when called:
This method performs the following steps when called:
The abstract operation ThisBooleanValue takes argument value (an ECMAScript language value ) and returns either a normal completion containing a Boolean or a throw completion . It performs the following steps when called:
Boolean instances are ordinary objects that inherit properties from the Boolean prototype object . Boolean instances have a [[BooleanData]] internal slot. The [[BooleanData]] internal slot is the Boolean value represented by this Boolean object.
20.4 Symbol Objects 20.4.1 The Symbol ConstructorThe Symbol constructor :
new
operator.extends
clause of a class definition but a super
call to it will cause an exception.This function performs the following steps when called:
The Symbol constructor :
The initial value of Symbol.asyncIterator
is the well-known symbol %Symbol.asyncIterator% ( Table 1 ).
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.4.2.2 Symbol.for ( key )This function performs the following steps when called:
The GlobalSymbolRegistry List is an append-only List that is globally available. It is shared by all realms . Prior to the evaluation of any ECMAScript code, it is initialized as a new empty List . Elements of the GlobalSymbolRegistry List are Records with the structure defined in Table 63 .
Table 63: GlobalSymbolRegistry Record Fields Field Name Value Usage [[Key]] a String A string key used to globally identify a Symbol. [[Symbol]] a Symbol A symbol that can be retrieved from any realm . 20.4.2.3 Symbol.hasInstanceThe initial value of Symbol.hasInstance
is the well-known symbol %Symbol.hasInstance% ( Table 1 ).
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.4.2.4 Symbol.isConcatSpreadableThe initial value of Symbol.isConcatSpreadable
is the well-known symbol %Symbol.isConcatSpreadable% ( Table 1 ).
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.4.2.5 Symbol.iteratorThe initial value of Symbol.iterator
is the well-known symbol %Symbol.iterator% ( Table 1 ).
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.4.2.6 Symbol.keyFor ( sym )This function performs the following steps when called:
The initial value of Symbol.match
is the well-known symbol %Symbol.match% ( Table 1 ).
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.4.2.8 Symbol.matchAllThe initial value of Symbol.matchAll
is the well-known symbol %Symbol.matchAll% ( Table 1 ).
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.4.2.9 Symbol.prototypeThe initial value of Symbol.prototype
is the Symbol prototype object .
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.4.2.10 Symbol.replaceThe initial value of Symbol.replace
is the well-known symbol %Symbol.replace% ( Table 1 ).
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.4.2.11 Symbol.searchThe initial value of Symbol.search
is the well-known symbol %Symbol.search% ( Table 1 ).
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.4.2.12 Symbol.speciesThe initial value of Symbol.species
is the well-known symbol %Symbol.species% ( Table 1 ).
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.4.2.13 Symbol.splitThe initial value of Symbol.split
is the well-known symbol %Symbol.split% ( Table 1 ).
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.4.2.14 Symbol.toPrimitiveThe initial value of Symbol.toPrimitive
is the well-known symbol %Symbol.toPrimitive% ( Table 1 ).
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.4.2.15 Symbol.toStringTagThe initial value of Symbol.toStringTag
is the well-known symbol %Symbol.toStringTag% ( Table 1 ).
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.4.2.16 Symbol.unscopablesThe initial value of Symbol.unscopables
is the well-known symbol %Symbol.unscopables% ( Table 1 ).
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.4.3 Properties of the Symbol Prototype ObjectThe Symbol prototype object:
The initial value of Symbol.prototype.constructor
is %Symbol% .
Symbol.prototype.description
is an accessor property whose set accessor function is undefined . Its get accessor function performs the following steps when called:
This method performs the following steps when called:
The abstract operation SymbolDescriptiveString takes argument sym (a Symbol) and returns a String. It performs the following steps when called:
This method performs the following steps when called:
The abstract operation ThisSymbolValue takes argument value (an ECMAScript language value ) and returns either a normal completion containing a Symbol or a throw completion . It performs the following steps when called:
This method is called by ECMAScript language operators to convert a Symbol object to a primitive value.
It performs the following steps when called:
The argument is ignored.
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: true }.
The value of the "name" property of this method is "[Symbol.toPrimitive]" .
20.4.3.6 Symbol.prototype [ %Symbol.toStringTag% ]The initial value of the %Symbol.toStringTag% property is the String value "Symbol" .
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: true }.
20.4.4 Properties of Symbol InstancesSymbol instances are ordinary objects that inherit properties from the Symbol prototype object . Symbol instances have a [[SymbolData]] internal slot. The [[SymbolData]] internal slot is the Symbol value represented by this Symbol object.
20.4.5 Abstract Operations for Symbols 20.4.5.1 KeyForSymbol ( sym )The abstract operation KeyForSymbol takes argument sym (a Symbol) and returns a String or undefined . If sym is in the GlobalSymbolRegistry List , the String used to register sym will be returned. It performs the following steps when called:
Instances of Error objects are thrown as exceptions when runtime errors occur. The Error objects may also serve as base objects for user-defined exception classes.
When an ECMAScript implementation detects a runtime error, it throws a new instance of one of the NativeError objects defined in 20.5.5 or a new instance of the AggregateError object defined in 20.5.7 .
20.5.1 The Error ConstructorThe Error constructor :
Error(…)
is equivalent to the object creation expression new Error(…)
with the same arguments.extends
clause of a class definition. Subclass constructors that intend to inherit the specified Error behaviour must include a super
call to the Error constructor to create and initialize subclass instances with an [[ErrorData]] internal slot.This function performs the following steps when called:
The Error constructor :
The initial value of Error.prototype
is the Error prototype object .
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.5.3 Properties of the Error Prototype ObjectThe Error prototype object:
The initial value of Error.prototype.constructor
is %Error% .
The initial value of Error.prototype.message
is the empty String.
The initial value of Error.prototype.name
is "Error" .
This method performs the following steps when called:
Error instances are ordinary objects that inherit properties from the Error prototype object and have an [[ErrorData]] internal slot whose value is undefined . The only specified uses of [[ErrorData]] is to identify Error, AggregateError, and NativeError instances as Error objects within Object.prototype.toString
.
A new instance of one of the NativeError objects below or of the AggregateError object is thrown when a runtime error is detected. All NativeError objects share the same structure, as described in 20.5.6 .
20.5.5.1 EvalErrorThe EvalError constructor is %EvalError%.
This exception is not currently used within this specification. This object remains for compatibility with previous editions of this specification.
20.5.5.2 RangeErrorThe RangeError constructor is %RangeError%.
Indicates a value that is not in the set or range of allowable values.
20.5.5.3 ReferenceErrorThe ReferenceError constructor is %ReferenceError%.
Indicate that an invalid reference has been detected.
20.5.5.4 SyntaxErrorThe SyntaxError constructor is %SyntaxError%.
Indicates that a parsing error has occurred.
20.5.5.5 TypeErrorThe TypeError constructor is %TypeError%.
TypeError is used to indicate an unsuccessful operation when none of the other NativeError objects are an appropriate indication of the failure cause.
20.5.5.6 URIErrorThe URIError constructor is %URIError%.
Indicates that one of the global URI handling functions was used in a way that is incompatible with its definition.
20.5.6 NativeError Object StructureEach of these objects has the structure described below, differing only in the name used as the constructor name and in the "name" property of the prototype object.
For each error object, references to NativeError in the definition should be replaced with the appropriate error object name from 20.5.5 .
20.5.6.1 The NativeError ConstructorsEach NativeError constructor :
NativeError(…)
is equivalent to the object creation expression new NativeError(…)
with the same arguments.extends
clause of a class definition. Subclass constructors that intend to inherit the specified NativeError behaviour must include a super
call to the NativeError constructor to create and initialize subclass instances with an [[ErrorData]] internal slot.Each NativeError function performs the following steps when called:
"%NativeError.prototype%"
, « [[ErrorData]] »).The actual value of the string passed in step 2 is either "%EvalError.prototype%" , "%RangeError.prototype%" , "%ReferenceError.prototype%" , "%SyntaxError.prototype%" , "%TypeError.prototype%" , or "%URIError.prototype%" corresponding to which NativeError constructor is being defined.
20.5.6.2 Properties of the NativeError ConstructorsEach NativeError constructor :
The initial value of NativeError.prototype
is a NativeError prototype object ( 20.5.6.3 ). Each NativeError constructor has a distinct prototype object.
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.5.6.3 Properties of the NativeError Prototype ObjectsEach NativeError prototype object:
The initial value of the "constructor" property of the prototype for a given NativeError constructor is the constructor itself.
20.5.6.3.2 NativeError.prototype.messageThe initial value of the "message" property of the prototype for a given NativeError constructor is the empty String.
20.5.6.3.3 NativeError.prototype.nameThe initial value of the "name" property of the prototype for a given NativeError constructor is the String value consisting of the name of the constructor (the name used instead of NativeError).
20.5.6.4 Properties of NativeError InstancesNativeError instances are ordinary objects that inherit properties from their NativeError prototype object and have an [[ErrorData]] internal slot whose value is undefined . The only specified use of [[ErrorData]] is by Object.prototype.toString
( 20.1.3.6 ) to identify Error, AggregateError, or NativeError instances.
The AggregateError constructor :
AggregateError(…)
is equivalent to the object creation expression new AggregateError(…)
with the same arguments.extends
clause of a class definition. Subclass constructors that intend to inherit the specified AggregateError behaviour must include a super
call to the AggregateError constructor to create and initialize subclass instances with an [[ErrorData]] internal slot.This function performs the following steps when called:
The AggregateError constructor :
The initial value of AggregateError.prototype
is %AggregateError.prototype% .
This property has the attributes { [[Writable]]: false , [[Enumerable]]: false , [[Configurable]]: false }.
20.5.7.3 Properties of the AggregateError Prototype ObjectThe AggregateError prototype object:
The initial value of AggregateError.prototype.constructor
is %AggregateError% .
The initial value of AggregateError.prototype.message
is the empty String.
The initial value of AggregateError.prototype.name
is "AggregateError" .
AggregateError instances are ordinary objects that inherit properties from their AggregateError prototype object and have an [[ErrorData]] internal slot whose value is undefined . The only specified use of [[ErrorData]] is by Object.prototype.toString
( 20.1.3.6 ) to identify Error, AggregateError, or NativeError instances.
The abstract operation InstallErrorCause takes arguments O (an Object) and options (an ECMAScript language value ) and returns either a normal completion containing unused or a throw completion . It is used to create a "cause" property on O when a "cause" property is present on options. It performs the following steps when called:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3