ECMAScript® 2027 Language Specification Pinsclear Table of Contents Introduction 1 Scope +2 Conformance 2.1 Example Normative Optional Clause Heading 2.2 Example Legacy Clause Heading 2.3 Example Legacy Normative Optional Clause Heading 3 Normative References +4 Overview 4.1 Web Scripting 4.2 Hosts and Implementations +4.3 ECMAScript Overview 4.3.1 Objects 4.3.2 The Strict Variant of ECMAScript +4.4 Terms and Definitions 4.4.1 implementation-approximated 4.4.2 implementation-defined 4.4.3 host-defined 4.4.4 type 4.4.5 primitive value 4.4.6 object 4.4.7 constructor 4.4.8 prototype 4.4.9 ordinary object 4.4.10 exotic object 4.4.11 standard object 4.4.12 built-in object 4.4.13 undefined value 4.4.14 Undefined type 4.4.15 null value 4.4.16 Null type 4.4.17 Boolean value 4.4.18 Boolean type 4.4.19 Boolean object 4.4.20 String value 4.4.21 String type 4.4.22 String object 4.4.23 Number value 4.4.24 Number type 4.4.25 Number object 4.4.26 Infinity 4.4.27 NaN 4.4.28 BigInt value 4.4.29 BigInt type 4.4.30 BigInt object 4.4.31 Symbol value 4.4.32 Symbol type 4.4.33 Symbol object 4.4.34 function 4.4.35 built-in function 4.4.36 built-in constructor 4.4.37 property 4.4.38 method 4.4.39 built-in method 4.4.40 attribute 4.4.41 own property 4.4.42 inherited property 4.5 Organization of This Specification +5 Notational Conventions +5.1 Syntactic and Lexical Grammars 5.1.1 Context-Free Grammars 5.1.2 The Lexical and RegExp Grammars 5.1.3 The Numeric String Grammar 5.1.4 The Syntactic Grammar +5.1.5 Grammar Notation 5.1.5.1 Terminal Symbols 5.1.5.2 Nonterminal Symbols and Productions 5.1.5.3 Optional Symbols 5.1.5.4 Grammatical Parameters 5.1.5.5 one of 5.1.5.6 [empty] 5.1.5.7 Lookahead Restrictions 5.1.5.8 [no LineTerminator here] 5.1.5.9 but not 5.1.5.10 Descriptive Phrases +5.2 Algorithm Conventions 5.2.1 Evaluation Order 5.2.2 Abstract Operations 5.2.3 Syntax-Directed Operations +5.2.4 Runtime Semantics 5.2.4.1 Completion ( completionRecord ) 5.2.4.2 Throw 5.2.4.3 Shorthands for Unwrapping Completion Records 5.2.4.4 Implicit Normal Completion 5.2.5 Static Semantics 5.2.6 Mathematical Operations 5.2.7 Value Notation 5.2.8 Identity +6 ECMAScript Data Types and Values +6.1 ECMAScript Language Types 6.1.1 The Undefined Type 6.1.2 The Null Type 6.1.3 The Boolean Type +6.1.4 The String Type 6.1.4.1 StringIndexOf ( string, searchValue, fromIndex ) 6.1.4.2 StringLastIndexOf ( string, searchValue, fromIndex ) +6.1.5 The Symbol Type 6.1.5.1 Well-Known Symbols +6.1.6 Numeric Types +6.1.6.1 The Number Type 6.1.6.1.1 Number::unaryMinus ( number ) 6.1.6.1.2 Number::bitwiseNOT ( number ) 6.1.6.1.3 Number::exponentiate ( base, exponent ) 6.1.6.1.4 Number::multiply ( x, y ) 6.1.6.1.5 Number::divide ( x, y ) 6.1.6.1.6 Number::remainder ( numerator, denominator ) 6.1.6.1.7 Number::add ( x, y ) 6.1.6.1.8 Number::subtract ( x, y ) 6.1.6.1.9 Number::leftShift ( x, y ) 6.1.6.1.10 Number::signedRightShift ( x, y ) 6.1.6.1.11 Number::unsignedRightShift ( x, y ) 6.1.6.1.12 Number::lessThan ( x, y ) 6.1.6.1.13 Number::equal ( x, y ) 6.1.6.1.14 Number::sameValue ( x, y ) 6.1.6.1.15 Number::sameValueZero ( x, y ) 6.1.6.1.16 NumberBitwiseOp ( op, x, y ) 6.1.6.1.17 Number::bitwiseAND ( x, y ) 6.1.6.1.18 Number::bitwiseXOR ( x, y ) 6.1.6.1.19 Number::bitwiseOR ( x, y ) 6.1.6.1.20 Number::toString ( x, radix ) +6.1.6.2 The BigInt Type 6.1.6.2.1 BigInt::unaryMinus ( bigint ) 6.1.6.2.2 BigInt::bitwiseNOT ( bigint ) 6.1.6.2.3 BigInt::exponentiate ( base, exponent ) 6.1.6.2.4 BigInt::multiply ( x, y ) 6.1.6.2.5 BigInt::divide ( x, y ) 6.1.6.2.6 BigInt::remainder ( numerator, denominator ) 6.1.6.2.7 BigInt::add ( x, y ) 6.1.6.2.8 BigInt::subtract ( x, y ) 6.1.6.2.9 BigInt::leftShift ( x, y ) 6.1.6.2.10 BigInt::signedRightShift ( x, y ) 6.1.6.2.11 BigInt::unsignedRightShift ( x, y ) 6.1.6.2.12 BigInt::lessThan ( x, y ) 6.1.6.2.13 BigInt::equal ( x, y ) 6.1.6.2.14 BinaryAnd ( x, y ) 6.1.6.2.15 BinaryOr ( x, y ) 6.1.6.2.16 BinaryXor ( x, y ) 6.1.6.2.17 BigIntBitwiseOp ( op, x, y ) 6.1.6.2.18 BigInt::bitwiseAND ( x, y ) 6.1.6.2.19 BigInt::bitwiseXOR ( x, y ) 6.1.6.2.20 BigInt::bitwiseOR ( x, y ) 6.1.6.2.21 BigInt::toString ( x, radix ) +6.1.7 The Object Type 6.1.7.1 Property Attributes 6.1.7.2 Object Internal Methods and Internal Slots 6.1.7.3 Invariants of the Essential Internal Methods 6.1.7.4 Well-Known Intrinsic Objects +6.2 ECMAScript Specification Types 6.2.1 The Enum Specification Type 6.2.2 The List and Record Specification Types 6.2.3 The Set and Relation Specification Types +6.2.4 The Completion Record Specification Type 6.2.4.1 NormalCompletion ( value ) 6.2.4.2 ThrowCompletion ( value ) 6.2.4.3 ReturnCompletion ( value ) 6.2.4.4 UpdateEmpty ( completionRecord, value ) +6.2.5 The Reference Record Specification Type 6.2.5.1 IsPropertyReference ( refRecord ) 6.2.5.2 IsUnresolvableReference ( refRecord ) 6.2.5.3 IsSuperReference ( refRecord ) 6.2.5.4 IsPrivateReference ( refRecord ) 6.2.5.5 GetValue ( refRecord ) 6.2.5.6 PutValue ( refRecord, value ) 6.2.5.7 GetThisValue ( refRecord ) 6.2.5.8 InitializeReferencedBinding ( refRecord, value ) 6.2.5.9 MakePrivateReference ( baseValue, privateIdentifier ) +6.2.6 The Property Descriptor Specification Type 6.2.6.1 IsAccessorDescriptor ( propertyDesc ) 6.2.6.2 IsDataDescriptor ( propertyDesc ) 6.2.6.3 IsGenericDescriptor ( propertyDesc ) 6.2.6.4 FromPropertyDescriptor ( propertyDesc ) 6.2.6.5 ToPropertyDescriptor ( obj ) 6.2.6.6 CompletePropertyDescriptor ( propertyDesc ) 6.2.7 The Environment Record Specification Type 6.2.8 The Abstract Closure Specification Type +6.2.9 Data Blocks 6.2.9.1 CreateByteDataBlock ( size ) 6.2.9.2 CreateSharedByteDataBlock ( size ) 6.2.9.3 CopyDataBlockBytes ( toBlock, toIndex, fromBlock, fromIndex, count ) 6.2.10 The PrivateElement Specification Type 6.2.11 The ClassFieldDefinition Record Specification Type 6.2.12 Private Names 6.2.13 The ClassStaticBlockDefinition Record Specification Type +7 Abstract Operations +7.1 Type Conversion +7.1.1 ToPrimitive ( input [ , preferredType ] ) 7.1.1.1 OrdinaryToPrimitive ( obj, hint ) 7.1.2 ToBoolean ( arg ) 7.1.3 ToNumeric ( arg ) +7.1.4 ToNumber ( arg ) +7.1.4.1 ToNumber Applied to the String Type 7.1.4.1.1 StringToNumber ( string ) 7.1.4.1.2 RS: StringNumericValue 7.1.4.1.3 RoundMVResult ( n ) 7.1.5 ToIntegerOrInfinity ( arg ) 7.1.6 SnapToInteger ( arg, nonIntHandling [ , minimum [ , maximum ] ] ) 7.1.7 ToFixedSizeInteger ( int, signed, bitWidth ) 7.1.8 ToInt32 ( arg ) 7.1.9 ToUint32 ( arg ) 7.1.10 ToInt16 ( arg ) 7.1.11 ToUint16 ( arg ) 7.1.12 ToInt8 ( arg ) 7.1.13 ToUint8 ( arg ) 7.1.14 ToUint8Clamp ( arg ) 7.1.15 ToBigInt ( arg ) +7.1.16 StringToBigInt ( string ) 7.1.16.1 StringIntegerLiteral Grammar 7.1.16.2 RS: MV 7.1.17 ToBigInt64 ( arg ) 7.1.18 ToBigUint64 ( arg ) 7.1.19 ToString ( arg ) 7.1.20 ToObject ( arg ) 7.1.21 ToPropertyKey ( arg ) 7.1.22 ToLength ( arg ) 7.1.23 CanonicalNumericIndexString ( arg ) 7.1.24 ToIndex ( arg ) 7.1.25 ToAbsoluteIndex ( value, length ) 7.1.26 ToClampedIndex ( value, length ) +7.2 Testing and Comparison Operations 7.2.1 RequireObjectCoercible ( arg ) 7.2.2 IsArray ( arg ) 7.2.3 IsCallable ( arg ) 7.2.4 IsConstructor ( arg ) 7.2.5 IsExtensible ( obj ) 7.2.6 IsRegExp ( arg ) 7.2.7 SS: IsStringWellFormedUnicode ( string ) 7.2.8 SameType ( x, y ) 7.2.9 SameValue ( x, y ) 7.2.10 SameValueZero ( x, y ) 7.2.11 SameValueNonNumber ( x, y ) 7.2.12 IsLessThan ( x, y, leftFirst ) 7.2.13 IsLooselyEqual ( x, y ) 7.2.14 IsStrictlyEqual ( x, y ) +7.3 Operations on Objects 7.3.1 MakeBasicObject ( internalSlotsList ) 7.3.2 Get ( obj, propertyKey ) 7.3.3 GetV ( value, propertyKey ) 7.3.4 Set ( obj, propertyKey, value, throw ) 7.3.5 CreateDataProperty ( obj, propertyKey, value ) 7.3.6 CreateDataPropertyOrThrow ( obj, propertyKey, value ) 7.3.7 CreateNonEnumerableDataPropertyOrThrow ( obj, propertyKey, value ) 7.3.8 DefinePropertyOrThrow ( obj, propertyKey, propertyDesc ) 7.3.9 DeletePropertyOrThrow ( obj, propertyKey ) 7.3.10 GetMethod ( value, propertyKey ) 7.3.11 HasProperty ( obj, propertyKey ) 7.3.12 HasOwnProperty ( obj, propertyKey ) 7.3.13 Call ( func, thisValue [ , argList ] ) 7.3.14 Construct ( ctor [ , argList [ , newTarget ] ] ) 7.3.15 SetIntegrityLevel ( obj, level ) 7.3.16 TestIntegrityLevel ( obj, level ) 7.3.17 CreateArrayFromList ( elements ) 7.3.18 LengthOfArrayLike ( obj ) 7.3.19 CreateListFromArrayLike ( obj [ , validElementTypes ] ) 7.3.20 Invoke ( value, propertyKey [ , argList ] ) 7.3.21 OrdinaryHasInstance ( ctor, instance ) 7.3.22 SpeciesConstructor ( obj, defaultCtor ) 7.3.23 EnumerableOwnProperties ( obj, kind ) 7.3.24 GetFunctionRealm ( func ) 7.3.25 CopyDataProperties ( target, source, excludedItems ) 7.3.26 PrivateElementFind ( obj, privateName ) 7.3.27 PrivateFieldAdd ( obj, privateName, value ) 7.3.28 PrivateMethodOrAccessorAdd ( obj, method ) 7.3.29 HostEnsureCanAddPrivateElement ( obj ) 7.3.30 PrivateGet ( obj, privateName ) 7.3.31 PrivateSet ( obj, privateName, value ) 7.3.32 DefineField ( receiver, fieldRecord ) 7.3.33 InitializeInstanceElements ( obj, ctor ) 7.3.34 AddValueToKeyedGroup ( groups, key, value ) 7.3.35 GroupBy ( items, callback, keyCoercion ) 7.3.36 GetOptionsObject ( options ) 7.3.37 SetterThatIgnoresPrototypeProperties ( thisValue, home, propertyKey, value ) +7.4 Operations on Iterator Objects 7.4.1 Iterator Records 7.4.2 GetIteratorDirect ( obj ) 7.4.3 GetIteratorFromMethod ( obj, method ) 7.4.4 GetIterator ( obj, kind ) 7.4.5 GetIteratorFlattenable ( obj, primitiveHandling ) 7.4.6 IteratorNext ( iteratorRecord [ , value ] ) 7.4.7 IteratorComplete ( iteratorResult ) 7.4.8 IteratorValue ( iteratorResult ) 7.4.9 IteratorStep ( iteratorRecord ) 7.4.10 IteratorStepValue ( iteratorRecord ) 7.4.11 IteratorClose ( iteratorRecord, completion ) 7.4.12 IteratorCloseAll ( iterators, completion ) 7.4.13 IfAbruptCloseIterator ( value, iteratorRecord ) 7.4.14 IfAbruptCloseIterators ( value, iteratorRecords ) 7.4.15 AsyncIteratorClose ( iteratorRecord, completion ) 7.4.16 IfAbruptCloseAsyncIterator ( value, iteratorRecord ) 7.4.17 CreateIteratorResultObject ( value, done ) 7.4.18 CreateListIteratorRecord ( list ) 7.4.19 IteratorToList ( iteratorRecord ) +7.5 Operations on Disposable Objects 7.5.1 DisposableResource Records 7.5.2 AddDisposableResource ( disposableResourceStack, value, kind [ , method ] ) 7.5.3 CreateDisposableResource ( value, kind [ , method ] ) 7.5.4 GetDisposeMethod ( value, kind ) 7.5.5 DisposeResources ( disposableResourceStack, completion ) +8 Syntax-Directed Operations 8.1 RS: Evaluation +8.2 Scope Analysis 8.2.1 SS: BoundNames 8.2.2 SS: DeclarationPart 8.2.3 SS: IsConstantDeclaration 8.2.4 SS: IsUsingDeclaration 8.2.5 SS: IsAwaitUsingDeclaration 8.2.6 SS: LexicallyDeclaredNames 8.2.7 SS: LexicallyScopedDeclarations 8.2.8 SS: VarDeclaredNames 8.2.9 SS: VarScopedDeclarations 8.2.10 SS: TopLevelLexicallyDeclaredNames 8.2.11 SS: TopLevelLexicallyScopedDeclarations 8.2.12 SS: TopLevelVarDeclaredNames 8.2.13 SS: TopLevelVarScopedDeclarations +8.3 Labels 8.3.1 SS: ContainsDuplicateLabels 8.3.2 SS: ContainsUndefinedBreakTarget 8.3.3 SS: ContainsUndefinedContinueTarget +8.4 Function Name Inference 8.4.1 SS: HasName 8.4.2 SS: IsFunctionDefinition 8.4.3 SS: IsAnonymousFunctionDefinition ( expr ) 8.4.4 SS: IsIdentifierRef 8.4.5 RS: NamedEvaluation +8.5 Contains 8.5.1 SS: Contains 8.5.2 SS: ComputedPropertyContains +8.6 Miscellaneous 8.6.1 RS: InstantiateFunctionObject +8.6.2 RS: BindingInitialization 8.6.2.1 InitializeBoundName ( name, value, envRecord ) 8.6.3 RS: IteratorBindingInitialization 8.6.4 SS: AssignmentTargetType 8.6.5 SS: PropName 8.6.6 SS: ContainsUsing +9 Executable Code and Execution Contexts +9.1 Environment Records +9.1.1 The Environment Record Type Hierarchy +9.1.1.1 Declarative Environment Records 9.1.1.1.1 HasBinding ( name ) 9.1.1.1.2 CreateMutableBinding ( name, deletable ) 9.1.1.1.3 CreateImmutableBinding ( name, strict ) 9.1.1.1.4 InitializeBinding ( name, value ) 9.1.1.1.5 SetMutableBinding ( name, value, strict ) 9.1.1.1.6 GetBindingValue ( name, strict ) 9.1.1.1.7 DeleteBinding ( name ) 9.1.1.1.8 HasThisBinding ( ) 9.1.1.1.9 GetThisBinding ( ) 9.1.1.1.10 HasSuperBinding ( ) 9.1.1.1.11 WithBaseObject ( ) +9.1.1.2 Object Environment Records 9.1.1.2.1 HasBinding ( name ) 9.1.1.2.2 CreateMutableBinding ( name, deletable ) 9.1.1.2.3 CreateImmutableBinding ( name, strict ) 9.1.1.2.4 InitializeBinding ( name, value ) 9.1.1.2.5 SetMutableBinding ( name, value, strict ) 9.1.1.2.6 GetBindingValue ( name, strict ) 9.1.1.2.7 DeleteBinding ( name ) 9.1.1.2.8 HasThisBinding ( ) 9.1.1.2.9 GetThisBinding ( ) 9.1.1.2.10 HasSuperBinding ( ) 9.1.1.2.11 WithBaseObject ( ) +9.1.1.3 Function Environment Records 9.1.1.3.1 BindThisValue ( envRecord, value ) 9.1.1.3.2 HasThisBinding ( ) 9.1.1.3.3 GetThisBinding ( ) 9.1.1.3.4 HasSuperBinding ( ) 9.1.1.3.5 GetSuperBase ( envRecord ) +9.1.1.4 Global Environment Records 9.1.1.4.1 HasBinding ( name ) 9.1.1.4.2 CreateMutableBinding ( name, deletable ) 9.1.1.4.3 CreateImmutableBinding ( name, strict ) 9.1.1.4.4 InitializeBinding ( name, value ) 9.1.1.4.5 SetMutableBinding ( name, value, strict ) 9.1.1.4.6 GetBindingValue ( name, strict ) 9.1.1.4.7 DeleteBinding ( name ) 9.1.1.4.8 HasThisBinding ( ) 9.1.1.4.9 GetThisBinding ( ) 9.1.1.4.10 HasSuperBinding ( ) 9.1.1.4.11 WithBaseObject ( ) 9.1.1.4.12 HasLexicalDeclaration ( envRecord, name ) 9.1.1.4.13 HasRestrictedGlobalProperty ( envRecord, name ) 9.1.1.4.14 CanDeclareGlobalVar ( envRecord, name ) 9.1.1.4.15 CanDeclareGlobalFunction ( envRecord, name ) 9.1.1.4.16 CreateGlobalVarBinding ( envRecord, name, deletable ) 9.1.1.4.17 CreateGlobalFunctionBinding ( envRecord, name, value, deletable ) +9.1.1.5 Module Environment Records 9.1.1.5.1 GetBindingValue ( name, strict ) 9.1.1.5.2 DeleteBinding ( name ) 9.1.1.5.3 HasThisBinding ( ) 9.1.1.5.4 GetThisBinding ( ) 9.1.1.5.5 CreateImportBinding ( envRecord, name, targetModule, targetName ) +9.1.2 Environment Record Operations 9.1.2.1 GetIdentifierReference ( envRecord, name, strict ) 9.1.2.2 NewDeclarativeEnvironment ( outerEnv ) 9.1.2.3 NewObjectEnvironment ( obj, isWithEnv, outerEnv ) 9.1.2.4 NewFunctionEnvironment ( func, newTarget ) 9.1.2.5 NewGlobalEnvironment ( obj, thisValue ) 9.1.2.6 NewModuleEnvironment ( outerEnv ) +9.2 PrivateEnvironment Records +9.2.1 PrivateEnvironment Record Operations 9.2.1.1 NewPrivateEnvironment ( outerPrivateEnv ) 9.2.1.2 ResolvePrivateIdentifier ( privateEnv, identifier ) +9.3 Realms 9.3.1 InitializeHostDefinedRealm ( ) 9.3.2 CreateIntrinsics ( realmRecord ) 9.3.3 SetDefaultGlobalBindings ( realmRecord ) +9.4 Execution Contexts 9.4.1 GetActiveScriptOrModule ( ) 9.4.2 ResolveBinding ( name [ , envRecord ] ) 9.4.3 GetThisEnvironment ( ) 9.4.4 ResolveThisBinding ( ) 9.4.5 GetNewTarget ( ) 9.4.6 GetGlobalObject ( ) 9.4.7 RunSuspendedContext ( context, completionRecord ) 9.4.8 RunCallerContext ( value ) +9.5 Jobs and Host Operations to Enqueue Jobs 9.5.1 JobCallback Records 9.5.2 HostMakeJobCallback ( callback ) 9.5.3 HostCallJobCallback ( jobCallback, thisValue, argList ) 9.5.4 HostEnqueueGenericJob ( job, realm ) 9.5.5 HostEnqueuePromiseJob ( job, realm ) 9.5.6 HostEnqueueTimeoutJob ( timeoutJob, realm, milliseconds ) +9.6 Agents 9.6.1 AgentSignifier ( ) 9.6.2 AgentCanSuspend ( ) 9.6.3 IncrementModuleAsyncEvaluationCount ( ) 9.7 Agent Clusters 9.8 Forward Progress +9.9 Processing Model of WeakRef and FinalizationRegistry Targets 9.9.1 Objectives 9.9.2 Liveness 9.9.3 Execution +9.9.4 Host Hooks 9.9.4.1 HostEnqueueFinalizationRegistryCleanupJob ( finalizationRegistry ) 9.10 ClearKeptObjects ( ) 9.11 AddToKeptObjects ( value ) 9.12 CleanupFinalizationRegistry ( finalizationRegistry ) 9.13 CanBeHeldWeakly ( arg ) +10 Ordinary and Exotic Objects Behaviours +10.1 Ordinary Object Internal Methods and Internal Slots +10.1.1 [[GetPrototypeOf]] ( ) 10.1.1.1 OrdinaryGetPrototypeOf ( obj ) +10.1.2 [[SetPrototypeOf]] ( proto ) 10.1.2.1 OrdinarySetPrototypeOf ( obj, proto ) +10.1.3 [[IsExtensible]] ( ) 10.1.3.1 OrdinaryIsExtensible ( obj ) +10.1.4 [[PreventExtensions]] ( ) 10.1.4.1 OrdinaryPreventExtensions ( obj ) +10.1.5 [[GetOwnProperty]] ( propertyKey ) 10.1.5.1 OrdinaryGetOwnProperty ( obj, propertyKey ) +10.1.6 [[DefineOwnProperty]] ( propertyKey, propertyDesc ) 10.1.6.1 OrdinaryDefineOwnProperty ( obj, propertyKey, propertyDesc ) 10.1.6.2 IsCompatiblePropertyDescriptor ( extensible, propertyDesc, current ) 10.1.6.3 ValidateAndApplyPropertyDescriptor ( obj, propertyKey, extensible, propertyDesc, current ) +10.1.7 [[HasProperty]] ( propertyKey ) 10.1.7.1 OrdinaryHasProperty ( obj, propertyKey ) +10.1.8 [[Get]] ( propertyKey, receiver ) 10.1.8.1 OrdinaryGet ( obj, propertyKey, receiver ) +10.1.9 [[Set]] ( propertyKey, value, receiver ) 10.1.9.1 OrdinarySet ( obj, propertyKey, value, receiver ) 10.1.9.2 OrdinarySetWithOwnDescriptor ( obj, propertyKey, value, receiver, ownDesc ) +10.1.10 [[Delete]] ( propertyKey ) 10.1.10.1 OrdinaryDelete ( obj, propertyKey ) +10.1.11 [[OwnPropertyKeys]] ( ) 10.1.11.1 OrdinaryOwnPropertyKeys ( obj ) 10.1.12 OrdinaryObjectCreate ( proto [ , additionalInternalSlotsList ] ) 10.1.13 OrdinaryCreateFromConstructor ( ctor, intrinsicDefaultProto [ , internalSlotsList ] ) 10.1.14 GetPrototypeFromConstructor ( ctor, intrinsicDefaultProto ) 10.1.15 RequireInternalSlot ( obj, internalSlot ) +10.2 ECMAScript Function Objects +10.2.1 [[Call]] ( thisArg, argList ) 10.2.1.1 PrepareForOrdinaryCall ( func, newTarget ) 10.2.1.2 OrdinaryCallBindThis ( func, calleeContext, thisArg ) 10.2.1.3 RS: EvaluateBody 10.2.1.4 OrdinaryCallEvaluateBody ( func, argList ) 10.2.2 [[Construct]] ( argList, newTarget ) 10.2.3 OrdinaryFunctionCreate ( proto, sourceText, paramList, body, thisMode, envRecord, privateEnv ) +10.2.4 AddRestrictedFunctionProperties ( func, realm ) 10.2.4.1 %ThrowTypeError% ( ) 10.2.5 MakeConstructor ( func [ , writableProto [ , proto ] ] ) 10.2.6 MakeClassConstructor ( func ) 10.2.7 MakeMethod ( func, homeObj ) 10.2.8 DefineMethodProperty ( homeObj, name, closure, enumerable ) 10.2.9 SetFunctionName ( func, name [ , prefix ] ) 10.2.10 SetFunctionLength ( func, length ) 10.2.11 FunctionDeclarationInstantiation ( func, argList ) +10.3 Built-in Function Objects 10.3.1 [[Call]] ( thisArg, argList ) 10.3.2 [[Construct]] ( argList, newTarget ) 10.3.3 BuiltinCallOrConstruct ( func, thisArg, argList, newTarget ) 10.3.4 CreateBuiltinFunction ( behaviour, length, name, additionalInternalSlotsList [ , realm [ , proto [ , prefix [ , async ] ] ] ] ) +10.4 Built-in Exotic Object Internal Methods and Slots +10.4.1 Bound Function Exotic Objects 10.4.1.1 [[Call]] ( thisArg, argList ) 10.4.1.2 [[Construct]] ( argList, newTarget ) 10.4.1.3 BoundFunctionCreate ( targetFunc, boundThis, boundArgs ) +10.4.2 Array Exotic Objects 10.4.2.1 [[DefineOwnProperty]] ( propertyKey, propertyDesc ) 10.4.2.2 ArrayCreate ( length [ , proto ] ) 10.4.2.3 ArraySpeciesCreate ( originalArray, length ) 10.4.2.4 ArraySetLength ( array, propertyDesc ) +10.4.3 String Exotic Objects 10.4.3.1 [[GetOwnProperty]] ( propertyKey ) 10.4.3.2 [[DefineOwnProperty]] ( propertyKey, propertyDesc ) 10.4.3.3 [[OwnPropertyKeys]] ( ) 10.4.3.4 StringCreate ( value, proto ) 10.4.3.5 StringGetOwnProperty ( string, propertyKey ) +10.4.4 Arguments Exotic Objects 10.4.4.1 [[GetOwnProperty]] ( propertyKey ) 10.4.4.2 [[DefineOwnProperty]] ( propertyKey, propertyDesc ) 10.4.4.3 [[Get]] ( propertyKey, receiver ) 10.4.4.4 [[Set]] ( propertyKey, value, receiver ) 10.4.4.5 [[Delete]] ( propertyKey ) 10.4.4.6 CreateUnmappedArgumentsObject ( argList ) +10.4.4.7 CreateMappedArgumentsObject ( func, formals, argList, envRecord ) 10.4.4.7.1 MakeArgGetter ( name, envRecord ) 10.4.4.7.2 MakeArgSetter ( name, envRecord ) +10.4.5 TypedArray Exotic Objects 10.4.5.1 [[PreventExtensions]] ( ) 10.4.5.2 [[GetOwnProperty]] ( propertyKey ) 10.4.5.3 [[HasProperty]] ( propertyKey ) 10.4.5.4 [[DefineOwnProperty]] ( propertyKey, propertyDesc ) 10.4.5.5 [[Get]] ( propertyKey, receiver ) 10.4.5.6 [[Set]] ( propertyKey, value, receiver ) 10.4.5.7 [[Delete]] ( propertyKey ) 10.4.5.8 [[OwnPropertyKeys]] ( ) 10.4.5.9 TypedArray With Buffer Witness Records 10.4.5.10 MakeTypedArrayWithBufferWitnessRecord ( obj, order ) 10.4.5.11 TypedArrayCreate ( proto ) 10.4.5.12 TypedArrayByteLength ( taRecord ) 10.4.5.13 TypedArrayLength ( taRecord ) 10.4.5.14 IsTypedArrayOutOfBounds ( taRecord ) 10.4.5.15 IsTypedArrayFixedLength ( obj ) 10.4.5.16 IsValidIntegerIndex ( obj, index ) 10.4.5.17 TypedArrayGetElement ( obj, index ) 10.4.5.18 TypedArraySetElement ( obj, index, value ) 10.4.5.19 IsArrayBufferViewOutOfBounds ( obj ) +10.4.6 Module Namespace Exotic Objects 10.4.6.1 [[GetPrototypeOf]] ( ) 10.4.6.2 [[SetPrototypeOf]] ( proto ) 10.4.6.3 [[IsExtensible]] ( ) 10.4.6.4 [[PreventExtensions]] ( ) 10.4.6.5 [[GetOwnProperty]] ( propertyKey ) 10.4.6.6 [[DefineOwnProperty]] ( propertyKey, propertyDesc ) 10.4.6.7 [[HasProperty]] ( propertyKey ) 10.4.6.8 [[Get]] ( propertyKey, receiver ) 10.4.6.9 [[Set]] ( propertyKey, value, receiver ) 10.4.6.10 [[Delete]] ( propertyKey ) 10.4.6.11 [[OwnPropertyKeys]] ( ) 10.4.6.12 ModuleNamespaceCreate ( module, exports ) +10.4.7 Immutable Prototype Exotic Objects 10.4.7.1 [[SetPrototypeOf]] ( proto ) 10.4.7.2 SetImmutablePrototype ( obj, proto ) +10.5 Proxy Object Internal Methods and Internal Slots 10.5.1 [[GetPrototypeOf]] ( ) 10.5.2 [[SetPrototypeOf]] ( proto ) 10.5.3 [[IsExtensible]] ( ) 10.5.4 [[PreventExtensions]] ( ) 10.5.5 [[GetOwnProperty]] ( propertyKey ) 10.5.6 [[DefineOwnProperty]] ( propertyKey, propertyDesc ) 10.5.7 [[HasProperty]] ( propertyKey ) 10.5.8 [[Get]] ( propertyKey, receiver ) 10.5.9 [[Set]] ( propertyKey, value, receiver ) 10.5.10 [[Delete]] ( propertyKey ) 10.5.11 [[OwnPropertyKeys]] ( ) 10.5.12 [[Call]] ( thisArg, argList ) 10.5.13 [[Construct]] ( argList, newTarget ) 10.5.14 ValidateNonRevokedProxy ( proxy ) 10.5.15 ProxyCreate ( target, handler ) +11 ECMAScript Language: Source Text +11.1 Source Text 11.1.1 SS: UTF16EncodeCodePoint ( codePoint ) 11.1.2 SS: CodePointsToString ( text ) 11.1.3 SS: UTF16SurrogatePairToCodePoint ( lead, trail ) 11.1.4 SS: CodePointAt ( string, position ) 11.1.5 SS: StringToCodePoints ( string ) 11.1.6 SS: ParseText ( sourceText, goalSymbol ) +11.2 Types of Source Code 11.2.1 Directive Prologues and the Use Strict Directive +11.2.2 Strict Mode Code 11.2.2.1 SS: IsStrict ( parseNode ) 11.2.3 Non-ECMAScript Functions +12 ECMAScript Language: Lexical Grammar 12.1 Unicode Format-Control Characters 12.2 White Space 12.3 Line Terminators 12.4 Comments 12.5 Hashbang Comments 12.6 Tokens +12.7 Names and Keywords +12.7.1 Identifier Names 12.7.1.1 SS: Early Errors 12.7.1.2 SS: IdentifierCodePoints 12.7.1.3 SS: IdentifierCodePoint 12.7.2 Keywords and Reserved Words 12.8 Punctuators +12.9 Literals 12.9.1 Null Literals 12.9.2 Boolean Literals +12.9.3 Numeric Literals 12.9.3.1 SS: Early Errors 12.9.3.2 SS: MV 12.9.3.3 SS: NumericValue +12.9.4 String Literals 12.9.4.1 SS: Early Errors 12.9.4.2 SS: SV 12.9.4.3 SS: MV +12.9.5 Regular Expression Literals 12.9.5.1 SS: BodyText 12.9.5.2 SS: FlagText +12.9.6 Template Literal Lexical Components 12.9.6.1 SS: TV 12.9.6.2 SS: TRV +12.10 Automatic Semicolon Insertion 12.10.1 Rules of Automatic Semicolon Insertion 12.10.2 Examples of Automatic Semicolon Insertion +12.10.3 Interesting Cases of Automatic Semicolon Insertion 12.10.3.1 Interesting Cases of Automatic Semicolon Insertion in Statement Lists +12.10.3.2 Cases of Automatic Semicolon Insertion and “[no LineTerminator here]” 12.10.3.2.1 List of Grammar Productions with Optional Operands and “[no LineTerminator here]” +13 ECMAScript Language: Expressions +13.1 Identifiers 13.1.1 SS: Early Errors 13.1.2 SS: StringValue 13.1.3 RS: Evaluation +13.2 Primary Expression +13.2.1 The this Keyword 13.2.1.1 RS: Evaluation 13.2.2 Identifier Reference +13.2.3 Literals 13.2.3.1 RS: Evaluation +13.2.4 Array Initializer 13.2.4.1 RS: ArrayAccumulation 13.2.4.2 RS: Evaluation +13.2.5 Object Initializer 13.2.5.1 SS: Early Errors 13.2.5.2 SS: IsComputedPropertyKey 13.2.5.3 SS: PropertyDefinitionNodes 13.2.5.4 SS: PropertyNameList 13.2.5.5 RS: Evaluation 13.2.5.6 RS: PropertyDefinitionEvaluation 13.2.6 Function Defining Expressions +13.2.7 Regular Expression Literals 13.2.7.1 SS: Early Errors 13.2.7.2 SS: IsValidRegularExpressionLiteral ( literal ) 13.2.7.3 RS: Evaluation +13.2.8 Template Literals 13.2.8.1 SS: Early Errors 13.2.8.2 SS: TemplateStrings 13.2.8.3 SS: TemplateString ( templateToken, escapes ) 13.2.8.4 GetTemplateObject ( templateLiteral ) 13.2.8.5 RS: SubstitutionEvaluation 13.2.8.6 RS: Evaluation +13.2.9 The Grouping Operator 13.2.9.1 SS: Early Errors 13.2.9.2 RS: Evaluation +13.3 Left-Hand-Side Expressions +13.3.1 Static Semantics 13.3.1.1 SS: Early Errors +13.3.2 Property Accessors 13.3.2.1 RS: Evaluation 13.3.3 EvaluatePropertyAccessWithExpressionKey ( baseValue, expr, strict ) 13.3.4 EvaluatePropertyAccessWithIdentifierKey ( baseValue, identifierName, strict ) +13.3.5 The new Operator +13.3.5.1 RS: Evaluation 13.3.5.1.1 EvaluateNew ( constructExpr, argumentsNode ) +13.3.6 Function Calls 13.3.6.1 RS: Evaluation 13.3.6.2 EvaluateCall ( func, thisValueRef, argumentListNode, tailPosition ) +13.3.7 The super Keyword 13.3.7.1 RS: Evaluation 13.3.7.2 GetSuperConstructor ( ) 13.3.7.3 MakeSuperPropertyReference ( actualThis, propertyKey, strict ) +13.3.8 Argument Lists 13.3.8.1 RS: ArgumentListEvaluation +13.3.9 Optional Chains 13.3.9.1 RS: Evaluation 13.3.9.2 RS: ChainEvaluation +13.3.10 Import Calls 13.3.10.1 RS: Evaluation 13.3.10.2 EvaluateImportCall ( specifierExpr [ , optionsExpr ] ) 13.3.10.3 ContinueDynamicImport ( promiseCapability, moduleCompletion ) +13.3.11 Tagged Templates 13.3.11.1 RS: Evaluation +13.3.12 Meta Properties +13.3.12.1 RS: Evaluation 13.3.12.1.1 HostGetImportMetaProperties ( moduleRecord ) 13.3.12.1.2 HostFinalizeImportMeta ( importMeta, moduleRecord ) +13.4 Update Expressions 13.4.1 SS: Early Errors +13.4.2 Postfix Increment Operator 13.4.2.1 RS: Evaluation +13.4.3 Postfix Decrement Operator 13.4.3.1 RS: Evaluation +13.4.4 Prefix Increment Operator 13.4.4.1 RS: Evaluation +13.4.5 Prefix Decrement Operator 13.4.5.1 RS: Evaluation +13.5 Unary Operators +13.5.1 The delete Operator 13.5.1.1 SS: Early Errors 13.5.1.2 RS: Evaluation +13.5.2 The void Operator 13.5.2.1 RS: Evaluation +13.5.3 The typeof Operator 13.5.3.1 RS: Evaluation +13.5.4 Unary + Operator 13.5.4.1 RS: Evaluation +13.5.5 Unary - Operator 13.5.5.1 RS: Evaluation +13.5.6 Bitwise NOT Operator ( ~ ) 13.5.6.1 RS: Evaluation +13.5.7 Logical NOT Operator ( ! ) 13.5.7.1 RS: Evaluation +13.6 Exponentiation Operator 13.6.1 RS: Evaluation +13.7 Multiplicative Operators 13.7.1 RS: Evaluation +13.8 Additive Operators +13.8.1 The Addition Operator ( + ) 13.8.1.1 RS: Evaluation +13.8.2 The Subtraction Operator ( - ) 13.8.2.1 RS: Evaluation +13.9 Bitwise Shift Operators +13.9.1 The Left Shift Operator ( << ) 13.9.1.1 RS: Evaluation +13.9.2 The Signed Right Shift Operator ( >> ) 13.9.2.1 RS: Evaluation +13.9.3 The Unsigned Right Shift Operator ( >>> ) 13.9.3.1 RS: Evaluation +13.10 Relational Operators 13.10.1 RS: Evaluation 13.10.2 InstanceofOperator ( value, target ) +13.11 Equality Operators 13.11.1 RS: Evaluation +13.12 Binary Bitwise Operators 13.12.1 RS: Evaluation +13.13 Binary Logical Operators 13.13.1 RS: Evaluation +13.14 Conditional Operator ( ? : ) 13.14.1 RS: Evaluation +13.15 Assignment Operators 13.15.1 SS: Early Errors 13.15.2 RS: Evaluation 13.15.3 ApplyStringOrNumericBinaryOperator ( leftValue, opText, rightValue ) 13.15.4 EvaluateStringOrNumericBinaryExpression ( leftOperand, opText, rightOperand ) +13.15.5 Destructuring Assignment 13.15.5.1 SS: Early Errors 13.15.5.2 RS: DestructuringAssignmentEvaluation 13.15.5.3 RS: PropertyDestructuringAssignmentEvaluation 13.15.5.4 RS: RestDestructuringAssignmentEvaluation 13.15.5.5 RS: IteratorDestructuringAssignmentEvaluation 13.15.5.6 RS: KeyedDestructuringAssignmentEvaluation +13.16 Comma Operator ( , ) 13.16.1 RS: Evaluation +14 ECMAScript Language: Statements and Declarations +14.1 Statement Semantics 14.1.1 RS: Evaluation +14.2 Block 14.2.1 SS: Early Errors 14.2.2 RS: Evaluation 14.2.3 BlockDeclarationInstantiation ( code, envRecord ) +14.3 Declarations and the Variable Statement +14.3.1 Let, Const, Using, and Await Using Declarations 14.3.1.1 SS: Early Errors 14.3.1.2 RS: Evaluation 14.3.1.3 RS: BindingEvaluation +14.3.2 Variable Statement 14.3.2.1 RS: Evaluation +14.3.3 Destructuring Binding Patterns 14.3.3.1 RS: PropertyBindingInitialization 14.3.3.2 RS: RestBindingInitialization 14.3.3.3 RS: KeyedBindingInitialization +14.4 Empty Statement 14.4.1 RS: Evaluation +14.5 Expression Statement 14.5.1 RS: Evaluation +14.6 The if Statement 14.6.1 SS: Early Errors 14.6.2 RS: Evaluation +14.7 Iteration Statements +14.7.1 Semantics 14.7.1.1 LoopContinues ( completion, labelSet ) 14.7.1.2 RS: LoopEvaluation +14.7.2 The do-while Statement 14.7.2.1 SS: Early Errors 14.7.2.2 RS: DoWhileLoopEvaluation +14.7.3 The while Statement 14.7.3.1 SS: Early Errors 14.7.3.2 RS: WhileLoopEvaluation +14.7.4 The for Statement 14.7.4.1 SS: Early Errors 14.7.4.2 RS: ForLoopEvaluation 14.7.4.3 ForBodyEvaluation ( test, increment, stmt, perIterationBindings, labelSet ) 14.7.4.4 CreatePerIterationEnvironment ( perIterationBindings ) +14.7.5 The for-in, for-of, and for-await-of Statements 14.7.5.1 SS: Early Errors 14.7.5.2 SS: IsDestructuring 14.7.5.3 RS: ForDeclarationBindingInitialization 14.7.5.4 RS: ForDeclarationBindingInstantiation 14.7.5.5 RS: ForInOfLoopEvaluation 14.7.5.6 ForIn/OfHeadEvaluation ( uninitializedBoundNames, expr, iterationKind ) 14.7.5.7 ForIn/OfBodyEvaluation ( lhs, stmt, iteratorRecord, iterationKind, lhsKind, labelSet [ , iteratorKind ] ) 14.7.5.8 RS: Evaluation 14.7.5.9 EnumerateObjectProperties ( obj ) +14.7.5.10 For-In Iterator Objects 14.7.5.10.1 CreateForInIterator ( obj ) +14.7.5.10.2 The %ForInIteratorPrototype% Object 14.7.5.10.2.1 %ForInIteratorPrototype%.next ( ) 14.7.5.10.3 Properties of For-In Iterator Instances +14.8 The continue Statement 14.8.1 SS: Early Errors 14.8.2 RS: Evaluation +14.9 The break Statement 14.9.1 SS: Early Errors 14.9.2 RS: Evaluation +14.10 The return Statement 14.10.1 RS: Evaluation +14.11 The with Statement 14.11.1 SS: Early Errors 14.11.2 RS: Evaluation +14.12 The switch Statement 14.12.1 SS: Early Errors 14.12.2 RS: CaseBlockEvaluation 14.12.3 CaseClauseIsSelected ( caseClauseNode, input ) 14.12.4 RS: Evaluation +14.13 Labelled Statements 14.13.1 SS: Early Errors 14.13.2 SS: IsLabelledFunction ( stmt ) 14.13.3 RS: Evaluation 14.13.4 RS: LabelledEvaluation +14.14 The throw Statement 14.14.1 RS: Evaluation +14.15 The try Statement 14.15.1 SS: Early Errors 14.15.2 RS: CatchClauseEvaluation 14.15.3 RS: Evaluation +14.16 The debugger Statement 14.16.1 RS: Evaluation +15 ECMAScript Language: Functions and Classes +15.1 Parameter Lists 15.1.1 SS: Early Errors 15.1.2 SS: ContainsExpression 15.1.3 SS: IsSimpleParameterList 15.1.4 SS: HasInitializer 15.1.5 SS: ExpectedArgumentCount +15.2 Function Definitions 15.2.1 SS: Early Errors 15.2.2 SS: FunctionBodyContainsUseStrict 15.2.3 RS: EvaluateFunctionBody 15.2.4 RS: InstantiateOrdinaryFunctionObject 15.2.5 RS: InstantiateOrdinaryFunctionExpression 15.2.6 RS: Evaluation +15.3 Arrow Function Definitions 15.3.1 SS: Early Errors 15.3.2 SS: ConciseBodyContainsUseStrict 15.3.3 RS: EvaluateConciseBody 15.3.4 RS: InstantiateArrowFunctionExpression 15.3.5 RS: Evaluation +15.4 Method Definitions 15.4.1 SS: Early Errors 15.4.2 SS: HasDirectSuper 15.4.3 SS: SpecialMethod 15.4.4 RS: DefineMethod 15.4.5 RS: MethodDefinitionEvaluation +15.5 Generator Function Definitions 15.5.1 SS: Early Errors 15.5.2 RS: EvaluateGeneratorBody 15.5.3 RS: InstantiateGeneratorFunctionObject 15.5.4 RS: InstantiateGeneratorFunctionExpression 15.5.5 RS: Evaluation +15.6 Async Generator Function Definitions 15.6.1 SS: Early Errors 15.6.2 RS: EvaluateAsyncGeneratorBody 15.6.3 RS: InstantiateAsyncGeneratorFunctionObject 15.6.4 RS: InstantiateAsyncGeneratorFunctionExpression 15.6.5 RS: Evaluation +15.7 Class Definitions 15.7.1 SS: Early Errors 15.7.2 SS: ClassElementKind 15.7.3 SS: ConstructorMethod 15.7.4 SS: IsStatic 15.7.5 SS: NonConstructorElements 15.7.6 SS: PrototypePropertyNameList 15.7.7 SS: AllPrivateIdentifiersValid 15.7.8 SS: PrivateBoundIdentifiers 15.7.9 SS: ContainsArguments 15.7.10 RS: ClassFieldDefinitionEvaluation 15.7.11 RS: ClassStaticBlockDefinitionEvaluation 15.7.12 RS: EvaluateClassStaticBlockBody 15.7.13 RS: ClassElementEvaluation 15.7.14 RS: ClassDefinitionEvaluation 15.7.15 RS: BindingClassDeclarationEvaluation 15.7.16 RS: Evaluation +15.8 Async Function Definitions 15.8.1 SS: Early Errors 15.8.2 RS: InstantiateAsyncFunctionObject 15.8.3 RS: InstantiateAsyncFunctionExpression 15.8.4 RS: EvaluateAsyncFunctionBody 15.8.5 RS: Evaluation +15.9 Async Arrow Function Definitions 15.9.1 SS: Early Errors 15.9.2 SS: AsyncConciseBodyContainsUseStrict 15.9.3 RS: EvaluateAsyncConciseBody 15.9.4 RS: InstantiateAsyncArrowFunctionExpression 15.9.5 RS: Evaluation +15.10 Tail Position Calls 15.10.1 SS: IsInTailPosition ( call ) 15.10.2 SS: HasCallInTailPosition 15.10.3 PrepareForTailCall ( ) +16 ECMAScript Language: Scripts and Modules +16.1 Scripts 16.1.1 SS: Early Errors 16.1.2 SS: ScriptIsStrict 16.1.3 RS: Evaluation 16.1.4 Script Records 16.1.5 ParseScript ( sourceText, realm, hostDefined ) 16.1.6 ScriptEvaluation ( scriptRecord ) 16.1.7 GlobalDeclarationInstantiation ( script, envRecord ) +16.2 Modules +16.2.1 Module Semantics 16.2.1.1 SS: Early Errors 16.2.1.2 SS: ImportedLocalNames ( importEntries ) +16.2.1.3 ModuleRequest Records 16.2.1.3.1 ModuleRequestsEqual ( x, y ) 16.2.1.4 SS: ModuleRequests +16.2.1.5 Abstract Module Records 16.2.1.5.1 EvaluateModuleSync ( module ) +16.2.1.6 Cyclic Module Records +16.2.1.6.1 Implementation of Module Record Abstract Methods +16.2.1.6.1.1 LoadRequestedModules ( [ hostDefined ] ) 16.2.1.6.1.1.1 InnerModuleLoading ( state, module ) 16.2.1.6.1.1.2 ContinueModuleLoading ( state, moduleCompletion ) +16.2.1.6.1.2 Link ( ) 16.2.1.6.1.2.1 InnerModuleLinking ( module, stack, index ) +16.2.1.6.1.3 Evaluate ( ) 16.2.1.6.1.3.1 InnerModuleEvaluation ( module, stack, index ) 16.2.1.6.1.3.2 ExecuteAsyncModule ( module ) 16.2.1.6.1.3.3 GatherAvailableAncestors ( module, execList ) 16.2.1.6.1.3.4 AsyncModuleExecutionFulfilled ( module ) 16.2.1.6.1.3.5 AsyncModuleExecutionRejected ( module, error ) 16.2.1.6.2 Example Cyclic Module Record Graphs +16.2.1.7 Source Text Module Records 16.2.1.7.1 ParseModule ( sourceText, realm, hostDefined ) +16.2.1.7.2 Implementation of Module Record Abstract Methods 16.2.1.7.2.1 GetExportedNames ( [ exportStarSet ] ) 16.2.1.7.2.2 ResolveExport ( exportName [ , resolveSet ] ) +16.2.1.7.3 Implementation of Cyclic Module Record Abstract Methods 16.2.1.7.3.1 InitializeEnvironment ( ) 16.2.1.7.3.2 ExecuteModule ( [ capability ] ) +16.2.1.8 Synthetic Module Records 16.2.1.8.1 CreateDefaultExportSyntheticModule ( defaultExport ) 16.2.1.8.2 ParseJSONModule ( source ) 16.2.1.8.3 SetSyntheticModuleExport ( module, exportName, exportValue ) +16.2.1.8.4 Implementation of Module Record Abstract Methods 16.2.1.8.4.1 LoadRequestedModules ( [ hostDefined ] ) 16.2.1.8.4.2 GetExportedNames ( [ exportStarSet ] ) 16.2.1.8.4.3 ResolveExport ( exportName [ , resolveSet ] ) 16.2.1.8.4.4 Link ( ) 16.2.1.8.4.5 Evaluate ( ) 16.2.1.9 GetImportedModule ( referrer, request ) 16.2.1.10 HostLoadImportedModule ( referrer, moduleRequest, hostDefined, payload ) 16.2.1.11 FinishLoadingImportedModule ( referrer, moduleRequest, payload, result ) +16.2.1.12 AllImportAttributesSupported ( attrs ) 16.2.1.12.1 HostGetSupportedImportAttributes ( ) 16.2.1.13 GetModuleNamespace ( module ) 16.2.1.14 RS: Evaluation +16.2.2 Imports 16.2.2.1 SS: Early Errors 16.2.2.2 SS: ImportEntries 16.2.2.3 SS: ImportEntriesForModule 16.2.2.4 SS: WithClauseToAttributes +16.2.3 Exports 16.2.3.1 SS: Early Errors 16.2.3.2 SS: ExportedBindings 16.2.3.3 SS: ExportedNames 16.2.3.4 SS: ExportEntries 16.2.3.5 SS: ExportEntriesForModule 16.2.3.6 SS: ReferencedBindings 16.2.3.7 RS: Evaluation +17 Error Handling and Language Extensions 17.1 Forbidden Extensions 18 ECMAScript Standard Built-in Objects +19 The Global Object +19.1 Value Properties of the Global Object 19.1.1 globalThis 19.1.2 Infinity 19.1.3 NaN 19.1.4 undefined +19.2 Function Properties of the Global Object +19.2.1 eval ( source ) 19.2.1.1 PerformEval ( source, strictCaller, direct ) 19.2.1.2 HostEnsureCanCompileStrings ( calleeRealm, paramStrings, bodyString, direct ) 19.2.1.3 EvalDeclarationInstantiation ( body, variableEnv, lexicalEnv, privateEnv, strict ) 19.2.2 isFinite ( value ) 19.2.3 isNaN ( value ) 19.2.4 parseFloat ( string ) 19.2.5 parseInt ( string, radix ) +19.2.6 URI Handling Functions 19.2.6.1 decodeURI ( encodedURI ) 19.2.6.2 decodeURIComponent ( encodedURIComponent ) 19.2.6.3 encodeURI ( uri ) 19.2.6.4 encodeURIComponent ( uriComponent ) 19.2.6.5 Encode ( string, extraUnescaped ) 19.2.6.6 Decode ( string, preserveEscapeSet ) 19.2.6.7 ParseHexOctet ( string, position ) +19.3 Constructor Properties of the Global Object 19.3.1 AggregateError ( . . . ) 19.3.2 Array ( . . . ) 19.3.3 ArrayBuffer ( . . . ) 19.3.4 AsyncDisposableStack ( . . . ) 19.3.5 BigInt ( . . . ) 19.3.6 BigInt64Array ( . . . ) 19.3.7 BigUint64Array ( . . . ) 19.3.8 Boolean ( . . . ) 19.3.9 DataView ( . . . ) 19.3.10 Date ( . . . ) 19.3.11 DisposableStack ( . . . ) 19.3.12 Error ( . . . ) 19.3.13 EvalError ( . . . ) 19.3.14 FinalizationRegistry ( . . . ) 19.3.15 Float16Array ( . . . ) 19.3.16 Float32Array ( . . . ) 19.3.17 Float64Array ( . . . ) 19.3.18 Function ( . . . ) 19.3.19 Int8Array ( . . . ) 19.3.20 Int16Array ( . . . ) 19.3.21 Int32Array ( . . . ) 19.3.22 Iterator ( . . . ) 19.3.23 Map ( . . . ) 19.3.24 Number ( . . . ) 19.3.25 Object ( . . . ) 19.3.26 Promise ( . . . ) 19.3.27 Proxy ( . . . ) 19.3.28 RangeError ( . . . ) 19.3.29 ReferenceError ( . . . ) 19.3.30 RegExp ( . . . ) 19.3.31 Set ( . . . ) 19.3.32 SharedArrayBuffer ( . . . ) 19.3.33 String ( . . . ) 19.3.34 SuppressedError ( . . . ) 19.3.35 Symbol ( . . . ) 19.3.36 SyntaxError ( . . . ) 19.3.37 TypeError ( . . . ) 19.3.38 Uint8Array ( . . . ) 19.3.39 Uint8ClampedArray ( . . . ) 19.3.40 Uint16Array ( . . . ) 19.3.41 Uint32Array ( . . . ) 19.3.42 URIError ( . . . ) 19.3.43 WeakMap ( . . . ) 19.3.44 WeakRef ( . . . ) 19.3.45 WeakSet ( . . . ) +19.4 Other Properties of the Global Object 19.4.1 Atomics 19.4.2 JSON 19.4.3 Math 19.4.4 Reflect +20 Fundamental Objects +20.1 Object Objects +20.1.1 The Object Constructor 20.1.1.1 Object ( value ) +20.1.2 Properties of the Object Constructor 20.1.2.1 Object.assign ( target, ...sources ) 20.1.2.2 Object.create ( proto, properties ) +20.1.2.3 Object.defineProperties ( obj, properties ) 20.1.2.3.1 ObjectDefineProperties ( obj, properties ) 20.1.2.4 Object.defineProperty ( obj, key, attrs ) 20.1.2.5 Object.entries ( obj ) 20.1.2.6 Object.freeze ( obj ) 20.1.2.7 Object.fromEntries ( iterable ) 20.1.2.8 Object.getOwnPropertyDescriptor ( obj, key ) 20.1.2.9 Object.getOwnPropertyDescriptors ( obj ) 20.1.2.10 Object.getOwnPropertyNames ( obj ) +20.1.2.11 Object.getOwnPropertySymbols ( obj ) 20.1.2.11.1 GetOwnPropertyKeys ( value, type ) 20.1.2.12 Object.getPrototypeOf ( obj ) 20.1.2.13 Object.groupBy ( items, callback ) 20.1.2.14 Object.hasOwn ( obj, key ) 20.1.2.15 Object.is ( value1, value2 ) 20.1.2.16 Object.isExtensible ( obj ) 20.1.2.17 Object.isFrozen ( obj ) 20.1.2.18 Object.isSealed ( obj ) 20.1.2.19 Object.keys ( obj ) 20.1.2.20 Object.preventExtensions ( obj ) 20.1.2.21 Object.prototype 20.1.2.22 Object.seal ( obj ) 20.1.2.23 Object.setPrototypeOf ( obj, proto ) 20.1.2.24 Object.values ( obj ) +20.1.3 Properties of the Object Prototype Object 20.1.3.1 Object.prototype.constructor 20.1.3.2 Object.prototype.hasOwnProperty ( value ) 20.1.3.3 Object.prototype.isPrototypeOf ( value ) 20.1.3.4 Object.prototype.propertyIsEnumerable ( value ) 20.1.3.5 Object.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] ) 20.1.3.6 Object.prototype.toString ( ) 20.1.3.7 Object.prototype.valueOf ( ) +20.1.3.8 Object.prototype.__proto__ 20.1.3.8.1 get Object.prototype.__proto__ 20.1.3.8.2 set Object.prototype.__proto__ +20.1.3.9 Legacy Object.prototype Accessor Methods 20.1.3.9.1 Object.prototype.__defineGetter__ ( key, getter ) 20.1.3.9.2 Object.prototype.__defineSetter__ ( key, setter ) 20.1.3.9.3 Object.prototype.__lookupGetter__ ( key ) 20.1.3.9.4 Object.prototype.__lookupSetter__ ( key ) 20.1.4 Properties of Object Instances +20.2 Function Objects +20.2.1 The Function Constructor +20.2.1.1 Function ( ...paramArgs, bodyArg ) 20.2.1.1.1 CreateDynamicFunction ( ctor, newTarget, kind, paramArgs, bodyArg ) +20.2.2 Properties of the Function Constructor 20.2.2.1 Function.prototype +20.2.3 Properties of the Function Prototype Object 20.2.3.1 Function.prototype.apply ( thisArg, argArray ) 20.2.3.2 Function.prototype.bind ( thisArg, ...args ) 20.2.3.3 Function.prototype.call ( thisArg, ...args ) 20.2.3.4 Function.prototype.constructor 20.2.3.5 Function.prototype.toString ( ) 20.2.3.6 Function.prototype [ %Symbol.hasInstance% ] ( value ) +20.2.4 Function Instances 20.2.4.1 length 20.2.4.2 name 20.2.4.3 prototype 20.2.5 HostHasSourceTextAvailable ( func ) +20.3 Boolean Objects +20.3.1 The Boolean Constructor 20.3.1.1 Boolean ( value ) +20.3.2 Properties of the Boolean Constructor 20.3.2.1 Boolean.prototype +20.3.3 Properties of the Boolean Prototype Object 20.3.3.1 Boolean.prototype.constructor 20.3.3.2 Boolean.prototype.toString ( ) +20.3.3.3 Boolean.prototype.valueOf ( ) 20.3.3.3.1 ThisBooleanValue ( arg ) 20.3.4 Properties of Boolean Instances +20.4 Symbol Objects +20.4.1 The Symbol Constructor 20.4.1.1 Symbol ( [ description ] ) +20.4.2 Properties of the Symbol Constructor 20.4.2.1 Symbol.asyncDispose 20.4.2.2 Symbol.asyncIterator 20.4.2.3 Symbol.dispose 20.4.2.4 Symbol.for ( key ) 20.4.2.5 Symbol.hasInstance 20.4.2.6 Symbol.isConcatSpreadable 20.4.2.7 Symbol.iterator 20.4.2.8 Symbol.keyFor ( symbol ) 20.4.2.9 Symbol.match 20.4.2.10 Symbol.matchAll 20.4.2.11 Symbol.prototype 20.4.2.12 Symbol.replace 20.4.2.13 Symbol.search 20.4.2.14 Symbol.species 20.4.2.15 Symbol.split 20.4.2.16 Symbol.toPrimitive 20.4.2.17 Symbol.toStringTag 20.4.2.18 Symbol.unscopables +20.4.3 Properties of the Symbol Prototype Object 20.4.3.1 Symbol.prototype.constructor 20.4.3.2 get Symbol.prototype.description +20.4.3.3 Symbol.prototype.toString ( ) 20.4.3.3.1 SymbolDescriptiveString ( symbol ) +20.4.3.4 Symbol.prototype.valueOf ( ) 20.4.3.4.1 ThisSymbolValue ( arg ) 20.4.3.5 Symbol.prototype [ %Symbol.toPrimitive% ] ( hint ) 20.4.3.6 Symbol.prototype [ %Symbol.toStringTag% ] 20.4.4 Properties of Symbol Instances +20.4.5 Abstract Operations for Symbols 20.4.5.1 GlobalSymbolRegistry Records 20.4.5.2 KeyForSymbol ( symbol ) +20.5 Error Objects +20.5.1 The Error Constructor 20.5.1.1 Error ( message [ , options ] ) +20.5.2 Properties of the Error Constructor 20.5.2.1 Error.isError ( arg ) 20.5.2.2 Error.prototype +20.5.3 Properties of the Error Prototype Object 20.5.3.1 Error.prototype.constructor 20.5.3.2 Error.prototype.message 20.5.3.3 Error.prototype.name 20.5.3.4 Error.prototype.toString ( ) 20.5.4 Properties of Error Instances +20.5.5 Native Error Types Used in This Standard 20.5.5.1 EvalError 20.5.5.2 RangeError 20.5.5.3 ReferenceError 20.5.5.4 SyntaxError 20.5.5.5 TypeError 20.5.5.6 URIError +20.5.6 NativeError Object Structure +20.5.6.1 The NativeError Constructors 20.5.6.1.1 NativeError ( message [ , options ] ) +20.5.6.2 Properties of the NativeError Constructors 20.5.6.2.1 NativeError.prototype +20.5.6.3 Properties of the NativeError Prototype Objects 20.5.6.3.1 NativeError.prototype.constructor 20.5.6.3.2 NativeError.prototype.message 20.5.6.3.3 NativeError.prototype.name 20.5.6.4 Properties of NativeError Instances +20.5.7 AggregateError Objects +20.5.7.1 The AggregateError Constructor 20.5.7.1.1 AggregateError ( errors, message [ , options ] ) +20.5.7.2 Properties of the AggregateError Constructor 20.5.7.2.1 AggregateError.prototype +20.5.7.3 Properties of the AggregateError Prototype Object 20.5.7.3.1 AggregateError.prototype.constructor 20.5.7.3.2 AggregateError.prototype.message 20.5.7.3.3 AggregateError.prototype.name 20.5.7.4 Properties of AggregateError Instances +20.5.8 SuppressedError Objects +20.5.8.1 The SuppressedError Constructor 20.5.8.1.1 SuppressedError ( error, suppressed, message ) +20.5.8.2 Properties of the SuppressedError Constructor 20.5.8.2.1 SuppressedError.prototype +20.5.8.3 Properties of the SuppressedError Prototype Object 20.5.8.3.1 SuppressedError.prototype.constructor 20.5.8.3.2 SuppressedError.prototype.message 20.5.8.3.3 SuppressedError.prototype.name 20.5.8.4 Properties of SuppressedError Instances +20.5.9 Abstract Operations for Error Objects 20.5.9.1 InstallErrorCause ( obj, options ) +21 Numbers and Dates +21.1 Number Objects +21.1.1 The Number Constructor 21.1.1.1 Number ( value ) +21.1.2 Properties of the Number Constructor 21.1.2.1 Number.EPSILON 21.1.2.2 Number.isFinite ( number ) 21.1.2.3 Number.isInteger ( number ) 21.1.2.4 Number.isNaN ( number ) 21.1.2.5 Number.isSafeInteger ( number ) 21.1.2.6 Number.MAX_SAFE_INTEGER 21.1.2.7 Number.MAX_VALUE 21.1.2.8 Number.MIN_SAFE_INTEGER 21.1.2.9 Number.MIN_VALUE 21.1.2.10 Number.NaN 21.1.2.11 Number.NEGATIVE_INFINITY 21.1.2.12 Number.parseFloat ( string ) 21.1.2.13 Number.parseInt ( string, radix ) 21.1.2.14 Number.POSITIVE_INFINITY 21.1.2.15 Number.prototype +21.1.3 Properties of the Number Prototype Object 21.1.3.1 Number.prototype.constructor 21.1.3.2 Number.prototype.toExponential ( fractionDigits ) 21.1.3.3 Number.prototype.toFixed ( fractionDigits ) 21.1.3.4 Number.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] ) 21.1.3.5 Number.prototype.toPrecision ( precision ) 21.1.3.6 Number.prototype.toString ( [ radix ] ) +21.1.3.7 Number.prototype.valueOf ( ) 21.1.3.7.1 ThisNumberValue ( arg ) 21.1.4 Properties of Number Instances +21.2 BigInt Objects +21.2.1 The BigInt Constructor +21.2.1.1 BigInt ( value ) 21.2.1.1.1 NumberToBigInt ( number ) +21.2.2 Properties of the BigInt Constructor 21.2.2.1 BigInt.asIntN ( bits, bigint ) 21.2.2.2 BigInt.asUintN ( bits, bigint ) 21.2.2.3 BigInt.prototype +21.2.3 Properties of the BigInt Prototype Object 21.2.3.1 BigInt.prototype.constructor 21.2.3.2 BigInt.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] ) 21.2.3.3 BigInt.prototype.toString ( [ radix ] ) +21.2.3.4 BigInt.prototype.valueOf ( ) 21.2.3.4.1 ThisBigIntValue ( arg ) 21.2.3.5 BigInt.prototype [ %Symbol.toStringTag% ] 21.2.4 Properties of BigInt Instances +21.3 The Math Object +21.3.1 Value Properties of the Math Object 21.3.1.1 Math.E 21.3.1.2 Math.LN10 21.3.1.3 Math.LN2 21.3.1.4 Math.LOG10E 21.3.1.5 Math.LOG2E 21.3.1.6 Math.PI 21.3.1.7 Math.SQRT1_2 21.3.1.8 Math.SQRT2 21.3.1.9 Math [ %Symbol.toStringTag% ] +21.3.2 Function Properties of the Math Object 21.3.2.1 Math.abs ( x ) 21.3.2.2 Math.acos ( x ) 21.3.2.3 Math.acosh ( x ) 21.3.2.4 Math.asin ( x ) 21.3.2.5 Math.asinh ( x ) 21.3.2.6 Math.atan ( x ) 21.3.2.7 Math.atanh ( x ) 21.3.2.8 Math.atan2 ( y, x ) 21.3.2.9 Math.cbrt ( x ) 21.3.2.10 Math.ceil ( x ) 21.3.2.11 Math.clz32 ( x ) 21.3.2.12 Math.cos ( x ) 21.3.2.13 Math.cosh ( x ) 21.3.2.14 Math.exp ( x ) 21.3.2.15 Math.expm1 ( x ) 21.3.2.16 Math.floor ( x ) 21.3.2.17 Math.fround ( x ) 21.3.2.18 Math.f16round ( x ) 21.3.2.19 Math.hypot ( ...args ) 21.3.2.20 Math.imul ( x, y ) 21.3.2.21 Math.log ( x ) 21.3.2.22 Math.log1p ( x ) 21.3.2.23 Math.log10 ( x ) 21.3.2.24 Math.log2 ( x ) 21.3.2.25 Math.max ( ...args ) 21.3.2.26 Math.min ( ...args ) 21.3.2.27 Math.pow ( base, exponent ) 21.3.2.28 Math.random ( ) 21.3.2.29 Math.round ( x ) 21.3.2.30 Math.sign ( x ) 21.3.2.31 Math.sin ( x ) 21.3.2.32 Math.sinh ( x ) 21.3.2.33 Math.sqrt ( x ) 21.3.2.34 Math.sumPrecise ( items ) 21.3.2.35 Math.tan ( x ) 21.3.2.36 Math.tanh ( x ) 21.3.2.37 Math.trunc ( x ) +21.4 Date Objects +21.4.1 Overview of Date Objects and Definitions of Abstract Operations 21.4.1.1 Time Values and Time Range 21.4.1.2 Time-related Constants 21.4.1.3 Day ( tv ) 21.4.1.4 TimeWithinDay ( tv ) 21.4.1.5 DayFromYear ( y ) 21.4.1.6 TimeFromYear ( y ) 21.4.1.7 YearFromTime ( tv ) 21.4.1.8 DayWithinYear ( tv ) 21.4.1.9 InLeapYear ( tv ) 21.4.1.10 MonthFromTime ( tv ) 21.4.1.11 DateFromTime ( tv ) 21.4.1.12 WeekDay ( tv ) 21.4.1.13 HourFromTime ( tv ) 21.4.1.14 MinuteFromTime ( tv ) 21.4.1.15 SecondFromTime ( tv ) 21.4.1.16 MillisecondFromTime ( tv ) 21.4.1.17 Epoch Nanoseconds and Range 21.4.1.18 GetUTCEpochNanoseconds ( year, month, day, hour, minute, second, millisecond, microsecond, nanosecond ) 21.4.1.19 Time Zone Identifiers 21.4.1.20 GetNamedTimeZoneEpochNanoseconds ( timeZoneIdentifier, year, month, day, hour, minute, second, millisecond, microsecond, nanosecond ) 21.4.1.21 GetNamedTimeZoneOffsetNanoseconds ( timeZoneIdentifier, epochNanoseconds ) 21.4.1.22 Time Zone Identifier Record 21.4.1.23 AvailableNamedTimeZoneIdentifiers ( ) 21.4.1.24 SystemTimeZoneIdentifier ( ) 21.4.1.25 LocalTime ( tv ) 21.4.1.26 UTC ( t ) 21.4.1.27 MakeTime ( hour, minute, second, millisecond ) 21.4.1.28 MakeDay ( year, month, day ) 21.4.1.29 MakeDate ( day, time ) 21.4.1.30 MakeFullYear ( year ) 21.4.1.31 TimeClip ( time ) +21.4.1.32 Date Time String Format 21.4.1.32.1 Expanded Years +21.4.1.33 Time Zone Offset String Format 21.4.1.33.1 IsTimeZoneOffsetString ( offsetString ) 21.4.1.33.2 ParseTimeZoneOffsetString ( offsetString ) +21.4.2 The Date Constructor 21.4.2.1 Date ( ...values ) +21.4.3 Properties of the Date Constructor 21.4.3.1 Date.now ( ) 21.4.3.2 Date.parse ( string ) 21.4.3.3 Date.prototype 21.4.3.4 Date.UTC ( year [ , month [ , day [ , hour [ , minute [ , second [ , millisecond ] ] ] ] ] ] ) +21.4.4 Properties of the Date Prototype Object 21.4.4.1 Date.prototype.constructor 21.4.4.2 Date.prototype.getDate ( ) 21.4.4.3 Date.prototype.getDay ( ) 21.4.4.4 Date.prototype.getFullYear ( ) 21.4.4.5 Date.prototype.getHours ( ) 21.4.4.6 Date.prototype.getMilliseconds ( ) 21.4.4.7 Date.prototype.getMinutes ( ) 21.4.4.8 Date.prototype.getMonth ( ) 21.4.4.9 Date.prototype.getSeconds ( ) 21.4.4.10 Date.prototype.getTime ( ) 21.4.4.11 Date.prototype.getTimezoneOffset ( ) 21.4.4.12 Date.prototype.getUTCDate ( ) 21.4.4.13 Date.prototype.getUTCDay ( ) 21.4.4.14 Date.prototype.getUTCFullYear ( ) 21.4.4.15 Date.prototype.getUTCHours ( ) 21.4.4.16 Date.prototype.getUTCMilliseconds ( ) 21.4.4.17 Date.prototype.getUTCMinutes ( ) 21.4.4.18 Date.prototype.getUTCMonth ( ) 21.4.4.19 Date.prototype.getUTCSeconds ( ) 21.4.4.20 Date.prototype.setDate ( day ) 21.4.4.21 Date.prototype.setFullYear ( year [ , month [ , day ] ] ) 21.4.4.22 Date.prototype.setHours ( hour [ , minute [ , second [ , millisecond ] ] ] ) 21.4.4.23 Date.prototype.setMilliseconds ( millisecond ) 21.4.4.24 Date.prototype.setMinutes ( minute [ , second [ , millisecond ] ] ) 21.4.4.25 Date.prototype.setMonth ( month [ , day ] ) 21.4.4.26 Date.prototype.setSeconds ( second [ , millisecond ] ) 21.4.4.27 Date.prototype.setTime ( time ) 21.4.4.28 Date.prototype.setUTCDate ( day ) 21.4.4.29 Date.prototype.setUTCFullYear ( year [ , month [ , day ] ] ) 21.4.4.30 Date.prototype.setUTCHours ( hour [ , minute [ , second [ , millisecond ] ] ] ) 21.4.4.31 Date.prototype.setUTCMilliseconds ( millisecond ) 21.4.4.32 Date.prototype.setUTCMinutes ( minute [ , second [ , millisecond ] ] ) 21.4.4.33 Date.prototype.setUTCMonth ( month [ , day ] ) 21.4.4.34 Date.prototype.setUTCSeconds ( second [ , millisecond ] ) 21.4.4.35 Date.prototype.toDateString ( ) 21.4.4.36 Date.prototype.toISOString ( ) 21.4.4.37 Date.prototype.toJSON ( key ) 21.4.4.38 Date.prototype.toLocaleDateString ( [ reserved1 [ , reserved2 ] ] ) 21.4.4.39 Date.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] ) 21.4.4.40 Date.prototype.toLocaleTimeString ( [ reserved1 [ , reserved2 ] ] ) +21.4.4.41 Date.prototype.toString ( ) 21.4.4.41.1 TimeString ( tv ) 21.4.4.41.2 DateString ( tv ) 21.4.4.41.3 TimeZoneString ( tv ) 21.4.4.41.4 ToDateString ( tv ) 21.4.4.42 Date.prototype.toTimeString ( ) 21.4.4.43 Date.prototype.toUTCString ( ) 21.4.4.44 Date.prototype.valueOf ( ) 21.4.4.45 Date.prototype [ %Symbol.toPrimitive% ] ( hint ) 21.4.5 Properties of Date Instances +22 Text Processing +22.1 String Objects +22.1.1 The String Constructor 22.1.1.1 String ( value ) +22.1.2 Properties of the String Constructor 22.1.2.1 String.fromCharCode ( ...codeUnits ) 22.1.2.2 String.fromCodePoint ( ...codePoints ) 22.1.2.3 String.prototype 22.1.2.4 String.raw ( template, ...substitutions ) +22.1.3 Properties of the String Prototype Object 22.1.3.1 String.prototype.at ( index ) 22.1.3.2 String.prototype.charAt ( position ) 22.1.3.3 String.prototype.charCodeAt ( position ) 22.1.3.4 String.prototype.codePointAt ( position ) 22.1.3.5 String.prototype.concat ( ...args ) 22.1.3.6 String.prototype.constructor 22.1.3.7 String.prototype.endsWith ( searchString [ , endPosition ] ) 22.1.3.8 String.prototype.includes ( searchString [ , position ] ) 22.1.3.9 String.prototype.indexOf ( searchString [ , position ] ) 22.1.3.10 String.prototype.isWellFormed ( ) 22.1.3.11 String.prototype.lastIndexOf ( searchString [ , position ] ) 22.1.3.12 String.prototype.localeCompare ( that [ , reserved1 [ , reserved2 ] ] ) 22.1.3.13 String.prototype.match ( regexpOrPattern ) 22.1.3.14 String.prototype.matchAll ( regexpOrPattern ) 22.1.3.15 String.prototype.normalize ( [ form ] ) 22.1.3.16 String.prototype.padEnd ( maxLength [ , fillString ] ) +22.1.3.17 String.prototype.padStart ( maxLength [ , fillString ] ) 22.1.3.17.1 StringPaddingBuiltinsImpl ( thisValue, maxLength, fillString, placement ) 22.1.3.17.2 StringPad ( string, maxLength, fillString, placement ) 22.1.3.17.3 ToZeroPaddedDecimalString ( n, minLength ) 22.1.3.18 String.prototype.repeat ( count ) +22.1.3.19 String.prototype.replace ( searchValue, replaceValue ) 22.1.3.19.1 GetSubstitution ( matched, string, position, captures, namedCaptures, replacementTemplate ) 22.1.3.20 String.prototype.replaceAll ( searchValue, replaceValue ) 22.1.3.21 String.prototype.search ( regexpOrPattern ) 22.1.3.22 String.prototype.slice ( start, end ) 22.1.3.23 String.prototype.split ( separator, limit ) 22.1.3.24 String.prototype.startsWith ( searchString [ , position ] ) 22.1.3.25 String.prototype.substring ( start, end ) 22.1.3.26 String.prototype.toLocaleLowerCase ( [ reserved1 [ , reserved2 ] ] ) 22.1.3.27 String.prototype.toLocaleUpperCase ( [ reserved1 [ , reserved2 ] ] ) 22.1.3.28 String.prototype.toLowerCase ( ) 22.1.3.29 String.prototype.toString ( ) 22.1.3.30 String.prototype.toUpperCase ( ) 22.1.3.31 String.prototype.toWellFormed ( ) +22.1.3.32 String.prototype.trim ( ) 22.1.3.32.1 TrimString ( arg, where ) 22.1.3.33 String.prototype.trimEnd ( ) 22.1.3.34 String.prototype.trimStart ( ) +22.1.3.35 String.prototype.valueOf ( ) 22.1.3.35.1 ThisStringValue ( arg ) 22.1.3.36 String.prototype [ %Symbol.iterator% ] ( ) +22.1.4 Properties of String Instances 22.1.4.1 length +22.1.5 String Iterator Objects +22.1.5.1 The %StringIteratorPrototype% Object 22.1.5.1.1 %StringIteratorPrototype%.next ( ) 22.1.5.1.2 %StringIteratorPrototype% [ %Symbol.toStringTag% ] +22.2 RegExp (Regular Expression) Objects +22.2.1 Patterns 22.2.1.1 SS: Early Errors 22.2.1.2 SS: CountLeftCapturingParensWithin ( parseNode ) 22.2.1.3 SS: CountLeftCapturingParensBefore ( parseNode ) 22.2.1.4 SS: MightBothParticipate ( x, y ) 22.2.1.5 SS: CapturingGroupNumber 22.2.1.6 SS: IsCharacterClass 22.2.1.7 SS: CharacterValue 22.2.1.8 SS: MayContainStrings 22.2.1.9 SS: GroupSpecifiersThatMatch ( thisGroupName ) 22.2.1.10 SS: CapturingGroupName 22.2.1.11 SS: RegExpIdentifierCodePoints 22.2.1.12 SS: RegExpIdentifierCodePoint +22.2.2 Pattern Semantics +22.2.2.1 Notation 22.2.2.1.1 RegExp Records 22.2.2.2 RS: CompilePattern +22.2.2.3 RS: CompileSubpattern 22.2.2.3.1 RepeatMatcher ( m, min, max, greedy, matchState, continue, parenIndex, parenCount ) 22.2.2.3.2 EmptyMatcher ( ) 22.2.2.3.3 MatchTwoAlternatives ( m1, m2 ) 22.2.2.3.4 MatchSequence ( m1, m2, direction ) +22.2.2.4 RS: CompileAssertion 22.2.2.4.1 IsWordChar ( regexpRecord, input, e ) 22.2.2.5 RS: CompileQuantifier 22.2.2.6 RS: CompileQuantifierPrefix +22.2.2.7 RS: CompileAtom 22.2.2.7.1 CharacterSetMatcher ( regexpRecord, charSet, invert, direction ) 22.2.2.7.2 BackreferenceMatcher ( regexpRecord, ns, direction ) 22.2.2.7.3 Canonicalize ( regexpRecord, char ) 22.2.2.7.4 UpdateModifiers ( regexpRecord, add, remove ) 22.2.2.8 RS: CompileCharacterClass +22.2.2.9 RS: CompileToCharSet 22.2.2.9.1 CharacterRange ( charSet, otherSet ) 22.2.2.9.2 HasEitherUnicodeFlag ( regexpRecord ) 22.2.2.9.3 WordCharacters ( regexpRecord ) 22.2.2.9.4 AllCharacters ( regexpRecord ) 22.2.2.9.5 MaybeSimpleCaseFolding ( regexpRecord, charSet ) 22.2.2.9.6 CharacterComplement ( regexpRecord, complement ) 22.2.2.9.7 UnicodeMatchProperty ( regexpRecord, p ) 22.2.2.9.8 UnicodeMatchPropertyValue ( p, v ) 22.2.2.10 RS: CompileClassSetString +22.2.3 Abstract Operations for RegExp Creation 22.2.3.1 RegExpCreate ( pattern, flags ) 22.2.3.2 RegExpAlloc ( newTarget ) 22.2.3.3 RegExpInitialize ( obj, pattern, flags ) 22.2.3.4 SS: ParsePattern ( patternText, u, v ) +22.2.4 The RegExp Constructor 22.2.4.1 RegExp ( patternOrRegexp, flags ) +22.2.5 Properties of the RegExp Constructor +22.2.5.1 RegExp.escape ( string ) 22.2.5.1.1 EncodeForRegExpEscape ( codePoint ) 22.2.5.2 RegExp.prototype 22.2.5.3 get RegExp [ %Symbol.species% ] +22.2.6 Properties of the RegExp Prototype Object 22.2.6.1 RegExp.prototype.constructor 22.2.6.2 RegExp.prototype.exec ( string ) 22.2.6.3 get RegExp.prototype.dotAll +22.2.6.4 get RegExp.prototype.flags 22.2.6.4.1 RegExpHasFlag ( regexp, codeUnit ) 22.2.6.5 get RegExp.prototype.global 22.2.6.6 get RegExp.prototype.hasIndices 22.2.6.7 get RegExp.prototype.ignoreCase 22.2.6.8 RegExp.prototype [ %Symbol.match% ] ( string ) 22.2.6.9 RegExp.prototype [ %Symbol.matchAll% ] ( string ) 22.2.6.10 get RegExp.prototype.multiline 22.2.6.11 RegExp.prototype [ %Symbol.replace% ] ( string, replaceValue ) 22.2.6.12 RegExp.prototype [ %Symbol.search% ] ( string ) +22.2.6.13 get RegExp.prototype.source 22.2.6.13.1 EscapeRegExpPattern ( pattern, flags ) 22.2.6.14 RegExp.prototype [ %Symbol.split% ] ( string, limit ) 22.2.6.15 get RegExp.prototype.sticky 22.2.6.16 RegExp.prototype.test ( string ) 22.2.6.17 RegExp.prototype.toString ( ) 22.2.6.18 get RegExp.prototype.unicode 22.2.6.19 get RegExp.prototype.unicodeSets +22.2.7 Abstract Operations for RegExp Matching 22.2.7.1 RegExpExec ( regexp, string ) 22.2.7.2 RegExpBuiltinExec ( regexp, string ) 22.2.7.3 AdvanceStringIndex ( string, index, unicode ) 22.2.7.4 GetStringIndex ( string, codePointIndex ) 22.2.7.5 Match Records 22.2.7.6 GetMatchString ( string, match ) 22.2.7.7 GetMatchIndexPair ( string, match ) 22.2.7.8 MakeMatchIndicesIndexPairArray ( string, indices, groupNames, hasGroups ) +22.2.8 Properties of RegExp Instances 22.2.8.1 lastIndex +22.2.9 RegExp String Iterator Objects 22.2.9.1 CreateRegExpStringIterator ( regexp, string, global, fullUnicode ) +22.2.9.2 The %RegExpStringIteratorPrototype% Object 22.2.9.2.1 %RegExpStringIteratorPrototype%.next ( ) 22.2.9.2.2 %RegExpStringIteratorPrototype% [ %Symbol.toStringTag% ] 22.2.9.3 Properties of RegExp String Iterator Instances +23 Indexed Collections +23.1 Array Objects +23.1.1 The Array Constructor 23.1.1.1 Array ( ...values ) +23.1.2 Properties of the Array Constructor 23.1.2.1 Array.from ( items [ , mapper [ , thisArg ] ] ) 23.1.2.2 Array.fromAsync ( items [ , mapper [ , thisArg ] ] ) 23.1.2.3 Array.isArray ( arg ) 23.1.2.4 Array.of ( ...items ) 23.1.2.5 Array.prototype 23.1.2.6 get Array [ %Symbol.species% ] +23.1.3 Properties of the Array Prototype Object 23.1.3.1 Array.prototype.at ( index ) +23.1.3.2 Array.prototype.concat ( ...items ) 23.1.3.2.1 IsConcatSpreadable ( obj ) 23.1.3.3 Array.prototype.constructor 23.1.3.4 Array.prototype.copyWithin ( target, start [ , end ] ) 23.1.3.5 Array.prototype.entries ( ) 23.1.3.6 Array.prototype.every ( callback [ , thisArg ] ) 23.1.3.7 Array.prototype.fill ( value [ , start [ , end ] ] ) 23.1.3.8 Array.prototype.filter ( callback [ , thisArg ] ) 23.1.3.9 Array.prototype.find ( predicate [ , thisArg ] ) 23.1.3.10 Array.prototype.findIndex ( predicate [ , thisArg ] ) 23.1.3.11 Array.prototype.findLast ( predicate [ , thisArg ] ) +23.1.3.12 Array.prototype.findLastIndex ( predicate [ , thisArg ] ) 23.1.3.12.1 FindViaPredicate ( obj, length, direction, predicate, thisArg ) +23.1.3.13 Array.prototype.flat ( [ depth ] ) 23.1.3.13.1 FlattenIntoArray ( target, source, sourceLength, start, depth [ , mapperFunc [ , thisArg ] ] ) 23.1.3.14 Array.prototype.flatMap ( mapperFunc [ , thisArg ] ) 23.1.3.15 Array.prototype.forEach ( callback [ , thisArg ] ) 23.1.3.16 Array.prototype.includes ( searchElement [ , fromIndex ] ) 23.1.3.17 Array.prototype.indexOf ( searchElement [ , fromIndex ] ) 23.1.3.18 Array.prototype.join ( separator ) 23.1.3.19 Array.prototype.keys ( ) 23.1.3.20 Array.prototype.lastIndexOf ( searchElement [ , fromIndex ] ) 23.1.3.21 Array.prototype.map ( callback [ , thisArg ] ) 23.1.3.22 Array.prototype.pop ( ) 23.1.3.23 Array.prototype.push ( ...items ) 23.1.3.24 Array.prototype.reduce ( callback [ , initialValue ] ) 23.1.3.25 Array.prototype.reduceRight ( callback [ , initialValue ] ) 23.1.3.26 Array.prototype.reverse ( ) 23.1.3.27 Array.prototype.shift ( ) 23.1.3.28 Array.prototype.slice ( start, end ) 23.1.3.29 Array.prototype.some ( callback [ , thisArg ] ) +23.1.3.30 Array.prototype.sort ( comparator ) 23.1.3.30.1 SortIndexedProperties ( obj, length, sortCompare, holes ) 23.1.3.30.2 CompareArrayElements ( x, y, comparator ) 23.1.3.31 Array.prototype.splice ( start, deleteCount, ...items ) 23.1.3.32 Array.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] ) 23.1.3.33 Array.prototype.toReversed ( ) 23.1.3.34 Array.prototype.toSorted ( comparator ) 23.1.3.35 Array.prototype.toSpliced ( start, skipCount, ...items ) 23.1.3.36 Array.prototype.toString ( ) 23.1.3.37 Array.prototype.unshift ( ...items ) 23.1.3.38 Array.prototype.values ( ) 23.1.3.39 Array.prototype.with ( index, value ) 23.1.3.40 Array.prototype [ %Symbol.iterator% ] ( ) 23.1.3.41 Array.prototype [ %Symbol.unscopables% ] +23.1.4 Properties of Array Instances 23.1.4.1 length +23.1.5 Array Iterator Objects 23.1.5.1 CreateArrayIterator ( array, kind ) +23.1.5.2 The %ArrayIteratorPrototype% Object 23.1.5.2.1 %ArrayIteratorPrototype%.next ( ) 23.1.5.2.2 %ArrayIteratorPrototype% [ %Symbol.toStringTag% ] 23.1.5.3 Properties of Array Iterator Instances +23.2 TypedArray Objects +23.2.1 The %TypedArray% Intrinsic Object 23.2.1.1 %TypedArray% ( ) +23.2.2 Properties of the %TypedArray% Intrinsic Object 23.2.2.1 %TypedArray%.from ( source [ , mapper [ , thisArg ] ] ) 23.2.2.2 %TypedArray%.of ( ...items ) 23.2.2.3 %TypedArray%.prototype 23.2.2.4 get %TypedArray% [ %Symbol.species% ] +23.2.3 Properties of the %TypedArray% Prototype Object 23.2.3.1 %TypedArray%.prototype.at ( index ) 23.2.3.2 get %TypedArray%.prototype.buffer 23.2.3.3 get %TypedArray%.prototype.byteLength 23.2.3.4 get %TypedArray%.prototype.byteOffset 23.2.3.5 %TypedArray%.prototype.constructor 23.2.3.6 %TypedArray%.prototype.copyWithin ( target, start [ , end ] ) 23.2.3.7 %TypedArray%.prototype.entries ( ) 23.2.3.8 %TypedArray%.prototype.every ( callback [ , thisArg ] ) 23.2.3.9 %TypedArray%.prototype.fill ( value [ , start [ , end ] ] ) 23.2.3.10 %TypedArray%.prototype.filter ( callback [ , thisArg ] ) 23.2.3.11 %TypedArray%.prototype.find ( predicate [ , thisArg ] ) 23.2.3.12 %TypedArray%.prototype.findIndex ( predicate [ , thisArg ] ) 23.2.3.13 %TypedArray%.prototype.findLast ( predicate [ , thisArg ] ) 23.2.3.14 %TypedArray%.prototype.findLastIndex ( predicate [ , thisArg ] ) 23.2.3.15 %TypedArray%.prototype.forEach ( callback [ , thisArg ] ) 23.2.3.16 %TypedArray%.prototype.includes ( searchElement [ , fromIndex ] ) 23.2.3.17 %TypedArray%.prototype.indexOf ( searchElement [ , fromIndex ] ) 23.2.3.18 %TypedArray%.prototype.join ( separator ) 23.2.3.19 %TypedArray%.prototype.keys ( ) 23.2.3.20 %TypedArray%.prototype.lastIndexOf ( searchElement [ , fromIndex ] ) 23.2.3.21 get %TypedArray%.prototype.length 23.2.3.22 %TypedArray%.prototype.map ( callback [ , thisArg ] ) 23.2.3.23 %TypedArray%.prototype.reduce ( callback [ , initialValue ] ) 23.2.3.24 %TypedArray%.prototype.reduceRight ( callback [ , initialValue ] ) 23.2.3.25 %TypedArray%.prototype.reverse ( ) +23.2.3.26 %TypedArray%.prototype.set ( source [ , offset ] ) 23.2.3.26.1 SetTypedArrayFromArrayLike ( target, targetOffset, source ) 23.2.3.26.2 SetTypedArrayFromTypedArray ( target, targetOffset, source ) 23.2.3.27 %TypedArray%.prototype.slice ( start, end ) 23.2.3.28 %TypedArray%.prototype.some ( callback [ , thisArg ] ) 23.2.3.29 %TypedArray%.prototype.sort ( comparator ) 23.2.3.30 %TypedArray%.prototype.subarray ( start, end ) 23.2.3.31 %TypedArray%.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] ) 23.2.3.32 %TypedArray%.prototype.toReversed ( ) 23.2.3.33 %TypedArray%.prototype.toSorted ( comparator ) 23.2.3.34 %TypedArray%.prototype.toString ( ) 23.2.3.35 %TypedArray%.prototype.values ( ) 23.2.3.36 %TypedArray%.prototype.with ( index, value ) 23.2.3.37 %TypedArray%.prototype [ %Symbol.iterator% ] ( ) 23.2.3.38 get %TypedArray%.prototype [ %Symbol.toStringTag% ] +23.2.4 Abstract Operations for TypedArray Objects 23.2.4.1 TypedArrayCreateFromConstructor ( ctor, argList ) 23.2.4.2 TypedArrayCreateSameType ( exemplar, length ) 23.2.4.3 TypedArraySpeciesCreate ( exemplar, argList ) 23.2.4.4 ValidateTypedArray ( obj, order ) 23.2.4.5 ValidateTypedArrayBounds ( ta, order ) 23.2.4.6 TypedArrayElementSize ( obj ) 23.2.4.7 TypedArrayElementType ( obj ) 23.2.4.8 CompareTypedArrayElements ( x, y, comparator ) +23.2.5 The TypedArray Constructors +23.2.5.1 TypedArray ( ...args ) 23.2.5.1.1 AllocateTypedArray ( ctorName, newTarget, defaultProto [ , length ] ) 23.2.5.1.2 InitializeTypedArrayFromTypedArray ( obj, sourceArray ) 23.2.5.1.3 InitializeTypedArrayFromArrayBuffer ( obj, buffer, byteOffset, length ) 23.2.5.1.4 InitializeTypedArrayFromList ( obj, values ) 23.2.5.1.5 InitializeTypedArrayFromArrayLike ( obj, arrayLike ) 23.2.5.1.6 AllocateTypedArrayBuffer ( obj, length ) +23.2.6 Properties of the TypedArray Constructors 23.2.6.1 TypedArray.BYTES_PER_ELEMENT 23.2.6.2 TypedArray.prototype +23.2.7 Properties of the TypedArray Prototype Objects 23.2.7.1 TypedArray.prototype.BYTES_PER_ELEMENT 23.2.7.2 TypedArray.prototype.constructor 23.2.8 Properties of TypedArray Instances +23.3 Uint8Array Objects +23.3.1 Additional Properties of the Uint8Array Constructor 23.3.1.1 Uint8Array.fromBase64 ( string [ , options ] ) 23.3.1.2 Uint8Array.fromHex ( string ) +23.3.2 Additional Properties of the Uint8Array Prototype Object 23.3.2.1 Uint8Array.prototype.setFromBase64 ( string [ , options ] ) 23.3.2.2 Uint8Array.prototype.setFromHex ( string ) 23.3.2.3 Uint8Array.prototype.toBase64 ( [ options ] ) 23.3.2.4 Uint8Array.prototype.toHex ( ) +23.3.3 Abstract Operations for Uint8Array Objects 23.3.3.1 ValidateUint8Array ( ta ) 23.3.3.2 GetUint8ArrayBytes ( ta ) 23.3.3.3 SetUint8ArrayBytes ( into, bytes ) 23.3.3.4 SkipAsciiWhitespace ( string, index ) 23.3.3.5 DecodeFinalBase64Chunk ( chunk, throwOnExtraBits ) 23.3.3.6 DecodeFullLengthBase64Chunk ( chunk ) 23.3.3.7 FromBase64 ( string, alphabet, lastChunkHandling [ , maxLength ] ) 23.3.3.8 FromHex ( string [ , maxLength ] ) +24 Keyed Collections +24.1 Map Objects +24.1.1 The Map Constructor 24.1.1.1 Map ( [ iterable ] ) 24.1.1.2 AddEntriesFromIterable ( target, iterable, adder ) +24.1.2 Properties of the Map Constructor 24.1.2.1 Map.groupBy ( items, callback ) 24.1.2.2 Map.prototype 24.1.2.3 get Map [ %Symbol.species% ] +24.1.3 Properties of the Map Prototype Object 24.1.3.1 Map.prototype.clear ( ) 24.1.3.2 Map.prototype.constructor 24.1.3.3 Map.prototype.delete ( key ) 24.1.3.4 Map.prototype.entries ( ) 24.1.3.5 Map.prototype.forEach ( callback [ , thisArg ] ) 24.1.3.6 Map.prototype.get ( key ) 24.1.3.7 Map.prototype.getOrInsert ( key, value ) 24.1.3.8 Map.prototype.getOrInsertComputed ( key, callback ) 24.1.3.9 Map.prototype.has ( key ) 24.1.3.10 Map.prototype.keys ( ) 24.1.3.11 Map.prototype.set ( key, value ) 24.1.3.12 get Map.prototype.size 24.1.3.13 Map.prototype.values ( ) 24.1.3.14 Map.prototype [ %Symbol.iterator% ] ( ) 24.1.3.15 Map.prototype [ %Symbol.toStringTag% ] 24.1.4 Properties of Map Instances +24.1.5 Map Iterator Objects 24.1.5.1 CreateMapIterator ( map, kind ) +24.1.5.2 The %MapIteratorPrototype% Object 24.1.5.2.1 %MapIteratorPrototype%.next ( ) 24.1.5.2.2 %MapIteratorPrototype% [ %Symbol.toStringTag% ] +24.2 Set Objects +24.2.1 Abstract Operations For Set Objects 24.2.1.1 Set Records 24.2.1.2 GetSetRecord ( obj ) 24.2.1.3 SetDataHas ( setData, value ) 24.2.1.4 SetDataIndex ( setData, value ) 24.2.1.5 SetDataSize ( setData ) +24.2.2 The Set Constructor 24.2.2.1 Set ( [ iterable ] ) +24.2.3 Properties of the Set Constructor 24.2.3.1 Set.prototype 24.2.3.2 get Set [ %Symbol.species% ] +24.2.4 Properties of the Set Prototype Object 24.2.4.1 Set.prototype.add ( value ) 24.2.4.2 Set.prototype.clear ( ) 24.2.4.3 Set.prototype.constructor 24.2.4.4 Set.prototype.delete ( value ) 24.2.4.5 Set.prototype.difference ( other ) 24.2.4.6 Set.prototype.entries ( ) 24.2.4.7 Set.prototype.forEach ( callback [ , thisArg ] ) 24.2.4.8 Set.prototype.has ( value ) 24.2.4.9 Set.prototype.intersection ( other ) 24.2.4.10 Set.prototype.isDisjointFrom ( other ) 24.2.4.11 Set.prototype.isSubsetOf ( other ) 24.2.4.12 Set.prototype.isSupersetOf ( other ) 24.2.4.13 Set.prototype.keys ( ) 24.2.4.14 get Set.prototype.size 24.2.4.15 Set.prototype.symmetricDifference ( other ) 24.2.4.16 Set.prototype.union ( other ) 24.2.4.17 Set.prototype.values ( ) 24.2.4.18 Set.prototype [ %Symbol.iterator% ] ( ) 24.2.4.19 Set.prototype [ %Symbol.toStringTag% ] 24.2.5 Properties of Set Instances +24.2.6 Set Iterator Objects 24.2.6.1 CreateSetIterator ( set, kind ) +24.2.6.2 The %SetIteratorPrototype% Object 24.2.6.2.1 %SetIteratorPrototype%.next ( ) 24.2.6.2.2 %SetIteratorPrototype% [ %Symbol.toStringTag% ] +24.3 WeakMap Objects +24.3.1 The WeakMap Constructor 24.3.1.1 WeakMap ( [ iterable ] ) +24.3.2 Properties of the WeakMap Constructor 24.3.2.1 WeakMap.prototype +24.3.3 Properties of the WeakMap Prototype Object 24.3.3.1 WeakMap.prototype.constructor 24.3.3.2 WeakMap.prototype.delete ( key ) 24.3.3.3 WeakMap.prototype.get ( key ) 24.3.3.4 WeakMap.prototype.getOrInsert ( key, value ) 24.3.3.5 WeakMap.prototype.getOrInsertComputed ( key, callback ) 24.3.3.6 WeakMap.prototype.has ( key ) 24.3.3.7 WeakMap.prototype.set ( key, value ) 24.3.3.8 WeakMap.prototype [ %Symbol.toStringTag% ] 24.3.4 Properties of WeakMap Instances +24.4 WeakSet Objects +24.4.1 The WeakSet Constructor 24.4.1.1 WeakSet ( [ iterable ] ) +24.4.2 Properties of the WeakSet Constructor 24.4.2.1 WeakSet.prototype +24.4.3 Properties of the WeakSet Prototype Object 24.4.3.1 WeakSet.prototype.add ( value ) 24.4.3.2 WeakSet.prototype.constructor 24.4.3.3 WeakSet.prototype.delete ( value ) 24.4.3.4 WeakSet.prototype.has ( value ) 24.4.3.5 WeakSet.prototype [ %Symbol.toStringTag% ] 24.4.4 Properties of WeakSet Instances +24.5 Abstract Operations for Keyed Collections 24.5.1 CanonicalizeKeyedCollectionKey ( key ) +25 Structured Data +25.1 ArrayBuffer Objects 25.1.1 Notation 25.1.2 Fixed-length and Resizable ArrayBuffer Objects +25.1.3 Abstract Operations For ArrayBuffer Objects 25.1.3.1 AllocateArrayBuffer ( ctor, byteLength [ , maxByteLength ] ) 25.1.3.2 ArrayBufferByteLength ( arrayBuffer, order ) 25.1.3.3 ArrayBufferCopyAndDetach ( arrayBuffer, newLength, preserveResizability ) 25.1.3.4 IsDetachedBuffer ( arrayBuffer ) 25.1.3.5 DetachArrayBuffer ( arrayBuffer [ , key ] ) 25.1.3.6 CloneArrayBuffer ( sourceBuffer, sourceByteOffset, sourceLength ) 25.1.3.7 GetArrayBufferMaxByteLengthOption ( options ) 25.1.3.8 HostResizeArrayBuffer ( buffer, newByteLength ) 25.1.3.9 IsFixedLengthArrayBuffer ( arrayBuffer ) 25.1.3.10 IsUnsignedElementType ( type ) 25.1.3.11 IsUnclampedIntegerElementType ( type ) 25.1.3.12 IsBigIntElementType ( type ) 25.1.3.13 IsNoTearConfiguration ( type, order ) 25.1.3.14 RawBytesToNumeric ( type, rawBytes, isLittleEndian ) 25.1.3.15 GetRawBytesFromSharedBlock ( block, byteIndex, type, isTypedArray, order ) 25.1.3.16 GetValueFromBuffer ( arrayBuffer, byteIndex, type, isTypedArray, order [ , isLittleEndian ] ) 25.1.3.17 NumericToRawBytes ( type, value, isLittleEndian ) 25.1.3.18 SetValueInBuffer ( arrayBuffer, byteIndex, type, value, isTypedArray, order [ , isLittleEndian ] ) 25.1.3.19 GetModifySetValueInBuffer ( arrayBuffer, byteIndex, type, value, op ) +25.1.4 The ArrayBuffer Constructor 25.1.4.1 ArrayBuffer ( length [ , options ] ) +25.1.5 Properties of the ArrayBuffer Constructor 25.1.5.1 ArrayBuffer.isView ( arg ) 25.1.5.2 ArrayBuffer.prototype 25.1.5.3 get ArrayBuffer [ %Symbol.species% ] +25.1.6 Properties of the ArrayBuffer Prototype Object 25.1.6.1 get ArrayBuffer.prototype.byteLength 25.1.6.2 ArrayBuffer.prototype.constructor 25.1.6.3 get ArrayBuffer.prototype.detached 25.1.6.4 get ArrayBuffer.prototype.maxByteLength 25.1.6.5 get ArrayBuffer.prototype.resizable 25.1.6.6 ArrayBuffer.prototype.resize ( newLength ) 25.1.6.7 ArrayBuffer.prototype.slice ( start, end ) 25.1.6.8 ArrayBuffer.prototype.transfer ( [ newLength ] ) 25.1.6.9 ArrayBuffer.prototype.transferToFixedLength ( [ newLength ] ) 25.1.6.10 ArrayBuffer.prototype [ %Symbol.toStringTag% ] 25.1.7 Properties of ArrayBuffer Instances 25.1.8 Resizable ArrayBuffer Guidelines +25.2 SharedArrayBuffer Objects 25.2.1 Fixed-length and Growable SharedArrayBuffer Objects +25.2.2 Abstract Operations for SharedArrayBuffer Objects 25.2.2.1 AllocateSharedArrayBuffer ( ctor, byteLength [ , maxByteLength ] ) 25.2.2.2 IsSharedArrayBuffer ( obj ) 25.2.2.3 IsGrowableSharedArrayBuffer ( obj ) 25.2.2.4 HostGrowSharedArrayBuffer ( buffer, newByteLength ) +25.2.3 The SharedArrayBuffer Constructor 25.2.3.1 SharedArrayBuffer ( length [ , options ] ) +25.2.4 Properties of the SharedArrayBuffer Constructor 25.2.4.1 SharedArrayBuffer.prototype 25.2.4.2 get SharedArrayBuffer [ %Symbol.species% ] +25.2.5 Properties of the SharedArrayBuffer Prototype Object 25.2.5.1 get SharedArrayBuffer.prototype.byteLength 25.2.5.2 SharedArrayBuffer.prototype.constructor 25.2.5.3 SharedArrayBuffer.prototype.grow ( newLength ) 25.2.5.4 get SharedArrayBuffer.prototype.growable 25.2.5.5 get SharedArrayBuffer.prototype.maxByteLength 25.2.5.6 SharedArrayBuffer.prototype.slice ( start, end ) 25.2.5.7 SharedArrayBuffer.prototype [ %Symbol.toStringTag% ] 25.2.6 Properties of SharedArrayBuffer Instances 25.2.7 Growable SharedArrayBuffer Guidelines +25.3 DataView Objects +25.3.1 Abstract Operations For DataView Objects 25.3.1.1 DataView With Buffer Witness Records 25.3.1.2 MakeDataViewWithBufferWitnessRecord ( obj, order ) 25.3.1.3 GetViewByteLength ( viewRecord ) 25.3.1.4 IsViewOutOfBounds ( viewRecord ) 25.3.1.5 GetViewValue ( view, requestIndex, isLittleEndian, type ) 25.3.1.6 SetViewValue ( view, requestIndex, isLittleEndian, type, value ) +25.3.2 The DataView Constructor 25.3.2.1 DataView ( buffer [ , byteOffset [ , byteLength ] ] ) +25.3.3 Properties of the DataView Constructor 25.3.3.1 DataView.prototype +25.3.4 Properties of the DataView Prototype Object 25.3.4.1 get DataView.prototype.buffer 25.3.4.2 get DataView.prototype.byteLength 25.3.4.3 get DataView.prototype.byteOffset 25.3.4.4 DataView.prototype.constructor 25.3.4.5 DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] ) 25.3.4.6 DataView.prototype.getBigUint64 ( byteOffset [ , littleEndian ] ) 25.3.4.7 DataView.prototype.getFloat16 ( byteOffset [ , littleEndian ] ) 25.3.4.8 DataView.prototype.getFloat32 ( byteOffset [ , littleEndian ] ) 25.3.4.9 DataView.prototype.getFloat64 ( byteOffset [ , littleEndian ] ) 25.3.4.10 DataView.prototype.getInt8 ( byteOffset ) 25.3.4.11 DataView.prototype.getInt16 ( byteOffset [ , littleEndian ] ) 25.3.4.12 DataView.prototype.getInt32 ( byteOffset [ , littleEndian ] ) 25.3.4.13 DataView.prototype.getUint8 ( byteOffset ) 25.3.4.14 DataView.prototype.getUint16 ( byteOffset [ , littleEndian ] ) 25.3.4.15 DataView.prototype.getUint32 ( byteOffset [ , littleEndian ] ) 25.3.4.16 DataView.prototype.setBigInt64 ( byteOffset, value [ , littleEndian ] ) 25.3.4.17 DataView.prototype.setBigUint64 ( byteOffset, value [ , littleEndian ] ) 25.3.4.18 DataView.prototype.setFloat16 ( byteOffset, value [ , littleEndian ] ) 25.3.4.19 DataView.prototype.setFloat32 ( byteOffset, value [ , littleEndian ] ) 25.3.4.20 DataView.prototype.setFloat64 ( byteOffset, value [ , littleEndian ] ) 25.3.4.21 DataView.prototype.setInt8 ( byteOffset, value ) 25.3.4.22 DataView.prototype.setInt16 ( byteOffset, value [ , littleEndian ] ) 25.3.4.23 DataView.prototype.setInt32 ( byteOffset, value [ , littleEndian ] ) 25.3.4.24 DataView.prototype.setUint8 ( byteOffset, value ) 25.3.4.25 DataView.prototype.setUint16 ( byteOffset, value [ , littleEndian ] ) 25.3.4.26 DataView.prototype.setUint32 ( byteOffset, value [ , littleEndian ] ) 25.3.4.27 DataView.prototype [ %Symbol.toStringTag% ] 25.3.5 Properties of DataView Instances +25.4 The Atomics Object 25.4.1 Waiter Record 25.4.2 WaiterList Records +25.4.3 Abstract Operations for Atomics 25.4.3.1 ValidateIntegerTypedArray ( ta, waitable ) 25.4.3.2 ValidateAtomicAccess ( taRecord, requestIndex ) 25.4.3.3 ValidateAtomicAccessOnIntegerTypedArray ( ta, requestIndex ) 25.4.3.4 RevalidateAtomicAccess ( ta, byteIndexInBuffer ) 25.4.3.5 GetWaiterList ( block, i ) 25.4.3.6 EnterCriticalSection ( waiterList ) 25.4.3.7 LeaveCriticalSection ( waiterList ) 25.4.3.8 AddWaiter ( waiterList, waiterRecord ) 25.4.3.9 RemoveWaiter ( waiterList, waiterRecord ) 25.4.3.10 RemoveWaiters ( waiterList, count ) 25.4.3.11 SuspendThisAgent ( waiterList, waiterRecord ) 25.4.3.12 NotifyWaiter ( waiterList, waiterRecord ) 25.4.3.13 EnqueueResolveInAgentJob ( agentSignifier, promiseCapability, resolution ) 25.4.3.14 DoWait ( mode, ta, index, value, timeout ) 25.4.3.15 EnqueueAtomicsWaitAsyncTimeoutJob ( waiterList, waiterRecord ) 25.4.3.16 AtomicCompareExchangeInSharedBlock ( block, byteIndexInBuffer, elementSize, expectedBytes, replacementBytes ) 25.4.3.17 AtomicReadModifyWrite ( ta, index, value, op ) 25.4.3.18 ByteListBitwiseOp ( op, xBytes, yBytes ) 25.4.3.19 ByteListEqual ( xBytes, yBytes ) 25.4.4 Atomics.add ( ta, index, value ) 25.4.5 Atomics.and ( ta, index, value ) 25.4.6 Atomics.compareExchange ( ta, index, expectedValue, replacementValue ) 25.4.7 Atomics.exchange ( ta, index, value ) 25.4.8 Atomics.isLockFree ( size ) 25.4.9 Atomics.load ( ta, index ) 25.4.10 Atomics.notify ( ta, index, count ) 25.4.11 Atomics.or ( ta, index, value ) 25.4.12 Atomics.pause ( ) 25.4.13 Atomics.store ( ta, index, value ) 25.4.14 Atomics.sub ( ta, index, value ) 25.4.15 Atomics.wait ( ta, index, value, timeout ) 25.4.16 Atomics.waitAsync ( ta, index, value, timeout ) 25.4.17 Atomics.xor ( ta, index, value ) 25.4.18 Atomics [ %Symbol.toStringTag% ] +25.5 The JSON Object 25.5.1 JSON.isRawJSON ( obj ) +25.5.2 JSON.parse ( text [ , reviver ] ) 25.5.2.1 ParseJSON ( text ) 25.5.2.2 JSON Parse Record 25.5.2.3 CreateJSONParseRecord ( parseNode, key, value ) 25.5.2.4 InternalizeJSONProperty ( holder, name, reviver, parseRecord ) 25.5.2.5 SS: ShallowestContainedJSONValue ( root ) 25.5.2.6 SS: JSONArrayLiteralContentNodes 25.5.3 JSON.rawJSON ( text ) +25.5.4 JSON.stringify ( value [ , replacer [ , space ] ] ) 25.5.4.1 JSON Serialization Record 25.5.4.2 SerializeJSONProperty ( state, key, holder ) 25.5.4.3 QuoteJSONString ( value ) 25.5.4.4 UnicodeEscape ( codeUnit ) 25.5.4.5 SerializeJSONObject ( state, value ) 25.5.4.6 SerializeJSONArray ( state, value ) 25.5.5 JSON [ %Symbol.toStringTag% ] +26 Managing Memory +26.1 WeakRef Objects +26.1.1 The WeakRef Constructor 26.1.1.1 WeakRef ( target ) +26.1.2 Properties of the WeakRef Constructor 26.1.2.1 WeakRef.prototype +26.1.3 Properties of the WeakRef Prototype Object 26.1.3.1 WeakRef.prototype.constructor 26.1.3.2 WeakRef.prototype.deref ( ) 26.1.3.3 WeakRef.prototype [ %Symbol.toStringTag% ] +26.1.4 WeakRef Abstract Operations 26.1.4.1 WeakRefDeref ( weakRef ) 26.1.5 Properties of WeakRef Instances +26.2 FinalizationRegistry Objects +26.2.1 The FinalizationRegistry Constructor 26.2.1.1 FinalizationRegistry ( cleanupCallback ) +26.2.2 Properties of the FinalizationRegistry Constructor 26.2.2.1 FinalizationRegistry.prototype +26.2.3 Properties of the FinalizationRegistry Prototype Object 26.2.3.1 FinalizationRegistry.prototype.constructor 26.2.3.2 FinalizationRegistry.prototype.register ( target, heldValue [ , unregisterToken ] ) 26.2.3.3 FinalizationRegistry.prototype.unregister ( unregisterToken ) 26.2.3.4 FinalizationRegistry.prototype [ %Symbol.toStringTag% ] 26.2.4 Properties of FinalizationRegistry Instances +27 Control Abstraction Objects +27.1 Iteration +27.1.1 Common Iteration Interfaces 27.1.1.1 The Iterable Interface 27.1.1.2 The Iterator Interface 27.1.1.3 The Async Iterable Interface 27.1.1.4 The Async Iterator Interface 27.1.1.5 The IteratorResult Interface +27.1.2 Iterator Helper Objects +27.1.2.1 The %IteratorHelperPrototype% Object 27.1.2.1.1 %IteratorHelperPrototype%.next ( ) 27.1.2.1.2 %IteratorHelperPrototype%.return ( ) 27.1.2.1.3 %IteratorHelperPrototype% [ %Symbol.toStringTag% ] +27.1.3 Iterator Objects +27.1.3.1 The Iterator Constructor 27.1.3.1.1 Iterator ( ) +27.1.3.2 Properties of the Iterator Constructor 27.1.3.2.1 Iterator.concat ( ...items ) +27.1.3.2.2 Iterator.from ( obj ) +27.1.3.2.2.1 The %WrapForValidIteratorPrototype% Object 27.1.3.2.2.1.1 %WrapForValidIteratorPrototype%.next ( ) 27.1.3.2.2.1.2 %WrapForValidIteratorPrototype%.return ( ) 27.1.3.2.3 Iterator.prototype 27.1.3.2.4 Iterator.zip ( iterables [ , options ] ) 27.1.3.2.5 Iterator.zipKeyed ( iterables [ , options ] ) +27.1.3.3 Properties of the Iterator Prototype Object +27.1.3.3.1 Iterator.prototype.constructor 27.1.3.3.1.1 get Iterator.prototype.constructor 27.1.3.3.1.2 set Iterator.prototype.constructor 27.1.3.3.2 Iterator.prototype.drop ( limit ) 27.1.3.3.3 Iterator.prototype.every ( predicate ) 27.1.3.3.4 Iterator.prototype.filter ( predicate ) 27.1.3.3.5 Iterator.prototype.find ( predicate ) 27.1.3.3.6 Iterator.prototype.flatMap ( mapper ) 27.1.3.3.7 Iterator.prototype.forEach ( procedure ) 27.1.3.3.8 Iterator.prototype.join ( separator ) 27.1.3.3.9 Iterator.prototype.map ( mapper ) 27.1.3.3.10 Iterator.prototype.reduce ( reducer [ , initialValue ] ) 27.1.3.3.11 Iterator.prototype.some ( predicate ) 27.1.3.3.12 Iterator.prototype.take ( limit ) 27.1.3.3.13 Iterator.prototype.toArray ( ) 27.1.3.3.14 Iterator.prototype [ %Symbol.dispose% ] ( ) 27.1.3.3.15 Iterator.prototype [ %Symbol.iterator% ] ( ) +27.1.3.3.16 Iterator.prototype [ %Symbol.toStringTag% ] 27.1.3.3.16.1 get Iterator.prototype [ %Symbol.toStringTag% ] 27.1.3.3.16.2 set Iterator.prototype [ %Symbol.toStringTag% ] +27.1.3.4 Abstract Operations for Iterators 27.1.3.4.1 IteratorZip ( iters, mode, padding, finishResults ) +27.1.4 The %AsyncIteratorPrototype% Object 27.1.4.1 %AsyncIteratorPrototype% [ %Symbol.asyncDispose% ] ( ) 27.1.4.2 %AsyncIteratorPrototype% [ %Symbol.asyncIterator% ] ( ) +27.1.5 Async-from-Sync Iterator Objects 27.1.5.1 CreateAsyncFromSyncIterator ( syncIteratorRecord ) +27.1.5.2 The %AsyncFromSyncIteratorPrototype% Object 27.1.5.2.1 %AsyncFromSyncIteratorPrototype%.next ( [ value ] ) 27.1.5.2.2 %AsyncFromSyncIteratorPrototype%.return ( [ value ] ) 27.1.5.2.3 %AsyncFromSyncIteratorPrototype%.throw ( [ value ] ) 27.1.5.3 Properties of Async-from-Sync Iterator Instances 27.1.5.4 AsyncFromSyncIteratorContinuation ( result, promiseCapability, syncIteratorRecord, closeOnRejection ) +27.2 Resource Management +27.2.1 Common Resource Management Interfaces 27.2.1.1 The Disposable Interface 27.2.1.2 The AsyncDisposable Interface +27.3 DisposableStack Objects +27.3.1 The DisposableStack Constructor 27.3.1.1 DisposableStack ( ) +27.3.2 Properties of the DisposableStack Constructor 27.3.2.1 DisposableStack.prototype +27.3.3 Properties of the DisposableStack Prototype Object 27.3.3.1 DisposableStack.prototype.adopt ( value, onDispose ) 27.3.3.2 DisposableStack.prototype.constructor 27.3.3.3 DisposableStack.prototype.defer ( onDispose ) 27.3.3.4 DisposableStack.prototype.dispose ( ) 27.3.3.5 get DisposableStack.prototype.disposed 27.3.3.6 DisposableStack.prototype.move ( ) 27.3.3.7 DisposableStack.prototype.use ( value ) 27.3.3.8 DisposableStack.prototype [ %Symbol.dispose% ] ( ) 27.3.3.9 DisposableStack.prototype [ %Symbol.toStringTag% ] 27.3.4 Properties of DisposableStack Instances +27.4 AsyncDisposableStack Objects +27.4.1 The AsyncDisposableStack Constructor 27.4.1.1 AsyncDisposableStack ( ) +27.4.2 Properties of the AsyncDisposableStack Constructor 27.4.2.1 AsyncDisposableStack.prototype +27.4.3 Properties of the AsyncDisposableStack Prototype Object 27.4.3.1 AsyncDisposableStack.prototype.adopt ( value, onDisposeAsync ) 27.4.3.2 AsyncDisposableStack.prototype.constructor 27.4.3.3 AsyncDisposableStack.prototype.defer ( onDisposeAsync ) 27.4.3.4 AsyncDisposableStack.prototype.disposeAsync ( ) 27.4.3.5 get AsyncDisposableStack.prototype.disposed 27.4.3.6 AsyncDisposableStack.prototype.move ( ) 27.4.3.7 AsyncDisposableStack.prototype.use ( value ) 27.4.3.8 AsyncDisposableStack.prototype [ %Symbol.asyncDispose% ] ( ) 27.4.3.9 AsyncDisposableStack.prototype [ %Symbol.toStringTag% ] 27.4.4 Properties of AsyncDisposableStack Instances +27.5 Promise Objects +27.5.1 Promise Abstract Operations +27.5.1.1 PromiseCapability Records 27.5.1.1.1 IfAbruptRejectPromise ( value, capability ) 27.5.1.2 PromiseReaction Records 27.5.1.3 CreateResolvingFunctions ( toResolve ) 27.5.1.4 FulfillPromise ( promise, value ) 27.5.1.5 NewPromiseCapability ( ctor ) 27.5.1.6 IsPromise ( arg ) 27.5.1.7 RejectPromise ( promise, reason ) 27.5.1.8 TriggerPromiseReactions ( reactions, arg ) 27.5.1.9 HostPromiseRejectionTracker ( promise, operation ) +27.5.2 Promise Jobs 27.5.2.1 NewPromiseReactionJob ( reaction, arg ) 27.5.2.2 NewPromiseResolveThenableJob ( promiseToResolve, thenable, then ) +27.5.3 The Promise Constructor 27.5.3.1 Promise ( executor ) +27.5.4 Properties of the Promise Constructor +27.5.4.1 Promise.all ( iterable ) 27.5.4.1.1 GetPromiseResolve ( promiseCtor ) 27.5.4.1.2 PerformPromiseAll ( iteratorRecord, ctor, resultCapability, promiseResolve ) +27.5.4.2 Promise.allSettled ( iterable ) 27.5.4.2.1 PerformPromiseAllSettled ( iteratorRecord, ctor, resultCapability, promiseResolve ) +27.5.4.3 Promise.any ( iterable ) 27.5.4.3.1 PerformPromiseAny ( iteratorRecord, ctor, resultCapability, promiseResolve ) 27.5.4.4 Promise.prototype +27.5.4.5 Promise.race ( iterable ) 27.5.4.5.1 PerformPromiseRace ( iteratorRecord, ctor, resultCapability, promiseResolve ) 27.5.4.6 Promise.reject ( reason ) +27.5.4.7 Promise.resolve ( resolution ) 27.5.4.7.1 PromiseResolve ( ctor, resolution ) 27.5.4.8 Promise.try ( callback, ...args ) 27.5.4.9 Promise.withResolvers ( ) 27.5.4.10 get Promise [ %Symbol.species% ] +27.5.5 Properties of the Promise Prototype Object 27.5.5.1 Promise.prototype.catch ( onRejected ) 27.5.5.2 Promise.prototype.constructor 27.5.5.3 Promise.prototype.finally ( onFinally ) +27.5.5.4 Promise.prototype.then ( onFulfilled, onRejected ) 27.5.5.4.1 PerformPromiseThen ( promise, onFulfilled, onRejected [ , resultCapability ] ) 27.5.5.5 Promise.prototype [ %Symbol.toStringTag% ] 27.5.6 Properties of Promise Instances +27.6 GeneratorFunction Objects +27.6.1 The GeneratorFunction Constructor 27.6.1.1 GeneratorFunction ( ...paramArgs, bodyArg ) +27.6.2 Properties of the GeneratorFunction Constructor 27.6.2.1 GeneratorFunction.prototype +27.6.3 Properties of the GeneratorFunction Prototype Object 27.6.3.1 GeneratorFunction.prototype.constructor 27.6.3.2 GeneratorFunction.prototype.prototype 27.6.3.3 GeneratorFunction.prototype [ %Symbol.toStringTag% ] +27.6.4 GeneratorFunction Instances 27.6.4.1 length 27.6.4.2 name 27.6.4.3 prototype +27.7 AsyncGeneratorFunction Objects +27.7.1 The AsyncGeneratorFunction Constructor 27.7.1.1 AsyncGeneratorFunction ( ...paramArgs, bodyArg ) +27.7.2 Properties of the AsyncGeneratorFunction Constructor 27.7.2.1 AsyncGeneratorFunction.prototype +27.7.3 Properties of the AsyncGeneratorFunction Prototype Object 27.7.3.1 AsyncGeneratorFunction.prototype.constructor 27.7.3.2 AsyncGeneratorFunction.prototype.prototype 27.7.3.3 AsyncGeneratorFunction.prototype [ %Symbol.toStringTag% ] +27.7.4 AsyncGeneratorFunction Instances 27.7.4.1 length 27.7.4.2 name 27.7.4.3 prototype +27.8 Generator Objects +27.8.1 The %GeneratorPrototype% Object 27.8.1.1 %GeneratorPrototype%.constructor 27.8.1.2 %GeneratorPrototype%.next ( value ) 27.8.1.3 %GeneratorPrototype%.return ( value ) 27.8.1.4 %GeneratorPrototype%.throw ( exception ) 27.8.1.5 %GeneratorPrototype% [ %Symbol.toStringTag% ] 27.8.2 Properties of Generator Instances +27.8.3 Generator Abstract Operations 27.8.3.1 GeneratorStart ( gen, genBody ) 27.8.3.2 GeneratorValidate ( gen, genBrand ) 27.8.3.3 GeneratorResume ( gen, value, genBrand ) 27.8.3.4 GeneratorResumeAbrupt ( gen, abruptCompletion, genBrand ) 27.8.3.5 GetGeneratorKind ( ) 27.8.3.6 GeneratorYield ( iteratorResult ) 27.8.3.7 Yield ( arg ) 27.8.3.8 CreateIteratorFromClosure ( closure, genBrand, genProto [ , extraSlots ] ) +27.9 AsyncGenerator Objects +27.9.1 The %AsyncGeneratorPrototype% Object 27.9.1.1 %AsyncGeneratorPrototype%.constructor 27.9.1.2 %AsyncGeneratorPrototype%.next ( value ) 27.9.1.3 %AsyncGeneratorPrototype%.return ( value ) 27.9.1.4 %AsyncGeneratorPrototype%.throw ( exception ) 27.9.1.5 %AsyncGeneratorPrototype% [ %Symbol.toStringTag% ] 27.9.2 Properties of AsyncGenerator Instances +27.9.3 AsyncGenerator Abstract Operations 27.9.3.1 AsyncGeneratorRequest Records 27.9.3.2 AsyncGeneratorStart ( gen, genBody ) 27.9.3.3 AsyncGeneratorValidate ( gen, genBrand ) 27.9.3.4 AsyncGeneratorEnqueue ( gen, completion, promiseCapability ) 27.9.3.5 AsyncGeneratorCompleteStep ( gen, completion, done [ , realm ] ) 27.9.3.6 AsyncGeneratorResume ( gen, completion ) 27.9.3.7 AsyncGeneratorUnwrapYieldResumption ( resumptionValue ) 27.9.3.8 AsyncGeneratorYield ( arg ) 27.9.3.9 AsyncGeneratorAwaitReturn ( gen ) 27.9.3.10 AsyncGeneratorDrainQueue ( gen ) +27.10 AsyncFunction Objects +27.10.1 The AsyncFunction Constructor 27.10.1.1 AsyncFunction ( ...paramArgs, bodyArg ) +27.10.2 Properties of the AsyncFunction Constructor 27.10.2.1 AsyncFunction.prototype +27.10.3 Properties of the AsyncFunction Prototype Object 27.10.3.1 AsyncFunction.prototype.constructor 27.10.3.2 AsyncFunction.prototype [ %Symbol.toStringTag% ] +27.10.4 AsyncFunction Instances 27.10.4.1 length 27.10.4.2 name +27.10.5 Async Functions Abstract Operations 27.10.5.1 AsyncFunctionStart ( promiseCapability, asyncFuncBody ) 27.10.5.2 AsyncBlockStart ( promiseCapability, asyncBody, asyncContext ) 27.10.5.3 Await ( arg ) +28 Reflection +28.1 The Reflect Object 28.1.1 Reflect.apply ( target, thisArg, args ) 28.1.2 Reflect.construct ( target, args [ , newTarget ] ) 28.1.3 Reflect.defineProperty ( target, key, attrs ) 28.1.4 Reflect.deleteProperty ( target, key ) 28.1.5 Reflect.get ( target, key [ , receiver ] ) 28.1.6 Reflect.getOwnPropertyDescriptor ( target, key ) 28.1.7 Reflect.getPrototypeOf ( target ) 28.1.8 Reflect.has ( target, key ) 28.1.9 Reflect.isExtensible ( target ) 28.1.10 Reflect.ownKeys ( target ) 28.1.11 Reflect.preventExtensions ( target ) 28.1.12 Reflect.set ( target, key, value [ , receiver ] ) 28.1.13 Reflect.setPrototypeOf ( target, proto ) 28.1.14 Reflect [ %Symbol.toStringTag% ] +28.2 Proxy Objects +28.2.1 The Proxy Constructor 28.2.1.1 Proxy ( target, handler ) +28.2.2 Properties of the Proxy Constructor 28.2.2.1 Proxy.revocable ( target, handler ) +28.3 Module Namespace Objects 28.3.1 %Symbol.toStringTag% +29 Memory Model 29.1 Memory Model Fundamentals 29.2 Agent Events Records 29.3 Chosen Value Records 29.4 Candidate Executions +29.5 Abstract Operations for the Memory Model 29.5.1 EventSet ( execution ) 29.5.2 SharedDataBlockEventSet ( execution ) 29.5.3 HostEventSet ( execution ) 29.5.4 ComposeWriteEventBytes ( execution, byteIndex, writes ) 29.5.5 ValueOfReadEvent ( execution, readEvent ) +29.6 Relations of Candidate Executions 29.6.1 is-agent-order-before 29.6.2 reads-bytes-from 29.6.3 reads-from 29.6.4 host-synchronizes-with 29.6.5 synchronizes-with 29.6.6 happens-before +29.7 Properties of Valid Executions 29.7.1 Valid Chosen Reads 29.7.2 Coherent Reads 29.7.3 Tear Free Reads 29.7.4 Sequentially Consistent Atomics 29.7.5 Valid Executions 29.8 Races 29.9 Data Races 29.10 Data Race Freedom 29.11 Shared Memory Guidelines +Annex A (informative) Grammar Summary A.1 Lexical Grammar A.2 Expressions A.3 Statements A.4 Functions and Classes A.5 Scripts and Modules A.6 Number Conversions A.7 Time Zone Offset String Format A.8 Regular Expressions +Annex B (normative) Additional ECMAScript Features for Web Browsers +B.1 Additional Syntax B.1.1 HTML-like Comments +B.1.2 Regular Expressions Patterns B.1.2.1 SS: Early Errors B.1.2.2 SS: CountLeftCapturingParensWithin and CountLeftCapturingParensBefore B.1.2.3 SS: IsCharacterClass B.1.2.4 SS: CharacterValue B.1.2.5 RS: CompileSubpattern B.1.2.6 RS: CompileAssertion B.1.2.7 RS: CompileAtom +B.1.2.8 RS: CompileToCharSet B.1.2.8.1 CharacterRangeOrUnion ( regexpRecord, charSet, otherSet ) B.1.2.9 SS: ParsePattern ( patternText, u, v ) +B.2 Additional Built-in Properties +B.2.1 Additional Properties of the Global Object B.2.1.1 escape ( string ) B.2.1.2 unescape ( string ) +B.2.2 Additional Properties of the String.prototype Object B.2.2.1 String.prototype.substr ( start, length ) +B.2.2.2 String.prototype.anchor ( name ) B.2.2.2.1 CreateHTML ( contents, tag, attr, attrValue ) B.2.2.3 String.prototype.big ( ) B.2.2.4 String.prototype.blink ( ) B.2.2.5 String.prototype.bold ( ) B.2.2.6 String.prototype.fixed ( ) B.2.2.7 String.prototype.fontcolor ( colour ) B.2.2.8 String.prototype.fontsize ( size ) B.2.2.9 String.prototype.italics ( ) B.2.2.10 String.prototype.link ( url ) B.2.2.11 String.prototype.small ( ) B.2.2.12 String.prototype.strike ( ) B.2.2.13 String.prototype.sub ( ) B.2.2.14 String.prototype.sup ( ) B.2.2.15 String.prototype.trimLeft ( ) B.2.2.16 String.prototype.trimRight ( ) +B.2.3 Additional Properties of the Date.prototype Object B.2.3.1 Date.prototype.getYear ( ) B.2.3.2 Date.prototype.setYear ( year ) B.2.3.3 Date.prototype.toGMTString ( ) +B.2.4 Additional Properties of the RegExp.prototype Object B.2.4.1 RegExp.prototype.compile ( pattern, flags ) +B.3 Other Additional Features B.3.1 Labelled Function Declarations B.3.2 Block-Level Function Declarations Web Legacy Compatibility Semantics B.3.3 FunctionDeclarations in IfStatement Statement Clauses B.3.4 VariableStatements in Catch Blocks B.3.5 Initializers in ForIn Statement Heads B.3.6 The [[IsHTMLDDA]] Internal Slot B.3.7 Non-default behaviour in HostMakeJobCallback B.3.8 Non-default behaviour in HostEnsureCanAddPrivateElement B.3.9 Runtime Errors for Function Call Assignment Targets Annex C (informative) The Strict Mode of ECMAScript +Annex D (informative) Host Layering Points D.1 Host Hooks D.2 Host-defined Fields D.3 Host-defined Objects D.4 Running Jobs D.5 Internal Methods of Exotic Objects D.6 Built-in Objects and Methods Annex E (informative) Corrections and Clarifications in ECMAScript 2015 with Possible Compatibility Impact Annex F (informative) Additions and Changes That Introduce Incompatibilities with Prior Editions Bibliography Colophon Copyright & Software License Menu Toggle shortcuts help? Toggle "can call user code" annotationsu Toggle early exit annotationse Navigate to/from multipagem Jump to search box/ Toggle pinning of the current clausep Jump to the nth pin1-9 Jump to the 10th pin0 Jump to the most recent link target` Multipage preference No preference Always single-page Always multi-page 21 Numbers and Dates 21.1 Number Objects 21.1.1 The Number Constructor The Number constructor: is %Number%. is the initial value of the "Number" property of the global object. creates and initializes a new Number object when called as a constructor. performs a type conversion when called as a function rather than as a constructor. may be used as the value of an extends clause of a class definition. Subclass constructors that intend to inherit the specified Number behaviour must include a super call to the Number constructor to create and initialize the subclass instance with a [[NumberData]] internal slot. 21.1.1.1 Number ( value ) This function performs the following steps when called: If value is present, then Let primitive be ? ToNumeric(value). If primitive is a BigInt, let n be 𝔽(ℝ(primitive)). Else, let n be primitive. Else, Let n be +0𝔽. If NewTarget is undefined, return n. Let obj be ? OrdinaryCreateFromConstructor(NewTarget, "%Number.prototype%", « [[NumberData]] »). Set obj.[[NumberData]] to n. Return obj. 21.1.2 Properties of the Number Constructor The Number constructor: has a [[Prototype]] internal slot whose value is %Function.prototype%. has the following properties: 21.1.2.1 Number.EPSILON The value of Number.EPSILON is the Number value for the magnitude of the difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately 2.2204460492503130808472633361816 × 10-16. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.1.2.2 Number.isFinite ( number ) This function performs the following steps when called: If number is a finite Number, return true. Return false. 21.1.2.3 Number.isInteger ( number ) This function performs the following steps when called: If number is an integral Number, return true. Return false. 21.1.2.4 Number.isNaN ( number ) This function performs the following steps when called: If number is not a Number, return false. If number is NaN, return true. Return false. Note This function differs from the global isNaN function (19.2.3) in that it does not convert its argument to a Number before determining whether it is NaN. 21.1.2.5 Number.isSafeInteger ( number ) Note An integer n is a “safe integer” if and only if the Number value for n is not the Number value for any other integer. This function performs the following steps when called: If number is an integral Number, then If abs(ℝ(number)) ≤ 253 - 1, return true. Return false. 21.1.2.6 Number.MAX_SAFE_INTEGER Note Due to rounding behaviour necessitated by precision limitations of IEEE 754-2019, the Number value for every integer greater than Number.MAX_SAFE_INTEGER is shared with at least one other integer. Such large-magnitude integers are therefore not safe, and are not guaranteed to be exactly representable as Number values or even to be distinguishable from each other. For example, both 9007199254740992 and 9007199254740993 evaluate to the Number value 9007199254740992𝔽. The value of Number.MAX_SAFE_INTEGER is 9007199254740991𝔽 (𝔽(253 - 1)). This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.1.2.7 Number.MAX_VALUE The value of Number.MAX_VALUE is the largest positive finite Number, which is approximately 1.7976931348623157 × 10308. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.1.2.8 Number.MIN_SAFE_INTEGER Note Due to rounding behaviour necessitated by precision limitations of IEEE 754-2019, the Number value for every integer less than Number.MIN_SAFE_INTEGER is shared with at least one other integer. Such large-magnitude integers are therefore not safe, and are not guaranteed to be exactly representable as Number values or even to be distinguishable from each other. For example, both -9007199254740992 and -9007199254740993 evaluate to the Number value -9007199254740992𝔽. The value of Number.MIN_SAFE_INTEGER is -9007199254740991𝔽 (𝔽(-(253 - 1))). This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.1.2.9 Number.MIN_VALUE The value of Number.MIN_VALUE is the smallest positive value of the Number type, which is approximately 5 × 10-324. In the IEEE 754-2019 double precision binary representation, the smallest possible value is a denormalized number. If an implementation does not support denormalized values, the value of Number.MIN_VALUE must be the smallest non-zero positive value that can actually be represented by the implementation. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.1.2.10 Number.NaN The value of Number.NaN is NaN. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.1.2.11 Number.NEGATIVE_INFINITY The value of Number.NEGATIVE_INFINITY is -∞𝔽. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.1.2.12 Number.parseFloat ( string ) The initial value of the "parseFloat" property is %parseFloat%. 21.1.2.13 Number.parseInt ( string, radix ) The initial value of the "parseInt" property is %parseInt%. 21.1.2.14 Number.POSITIVE_INFINITY The value of Number.POSITIVE_INFINITY is +∞𝔽. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.1.2.15 Number.prototype The initial value of Number.prototype is the Number prototype object. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.1.3 Properties of the Number Prototype Object The Number prototype object: is %Number.prototype%. is an ordinary object. is itself a Number object; it has a [[NumberData]] internal slot with the value +0𝔽. has a [[Prototype]] internal slot whose value is %Object.prototype%. Unless explicitly stated otherwise, the methods of the Number prototype object defined below are not generic and the this value passed to them must be either a Number value or an object that has a [[NumberData]] internal slot that has been initialized to a Number value. The phrase “this Number value” within the specification of a method refers to the result returned by calling the abstract operation ThisNumberValue with the this value of the method invocation passed as the argument. 21.1.3.1 Number.prototype.constructor The initial value of Number.prototype.constructor is %Number%. 21.1.3.2 Number.prototype.toExponential ( fractionDigits ) This method returns a String containing this Number value represented in decimal exponential notation with one digit before the significand's decimal point and fractionDigits digits after the significand's decimal point. If fractionDigits is undefined, it includes as many significand digits as necessary to uniquely specify the Number (just like in ToString except that in this case the Number is always output in exponential notation). It performs the following steps when called: Let number be ? ThisNumberValue(this value). Let fractionCount be ? ToIntegerOrInfinity(fractionDigits). Assert: If fractionDigits is undefined, then fractionCount is 0. If number is not a finite Number, return Number::toString(number, 10). If fractionCount is not an integer, throw a RangeError exception. If fractionCount < 0 or fractionCount > 100, throw a RangeError exception. Set number to ℝ(number). Let sign be the empty String. If number < 0, then Set sign to "-". Set number to -number. If number = 0, then Let significand be the String value consisting of fractionCount + 1 occurrences of the code unit 0x0030 (DIGIT ZERO). Let exponent be 0. Else, If fractionDigits is not undefined, then Let exponent and intSignificand be integers such that 10fractionCount ≤ intSignificand < 10fractionCount + 1 and for which intSignificand × 10exponent - fractionCount - number is as close to zero as possible. If there are two such sets of exponent and intSignificand, pick the exponent and intSignificand for which intSignificand × 10exponent - fractionCount is larger. Else, Let exponent, intSignificand, and ff be integers such that ff ≥ 0, 10ff ≤ intSignificand < 10ff + 1, 𝔽(intSignificand × 10exponent - ff) is 𝔽(number), and ff is as small as possible. Note that the decimal representation of intSignificand has ff + 1 digits, intSignificand is not divisible by 10, and the least significant digit of intSignificand is not necessarily uniquely determined by these criteria. Set fractionCount to ff. Let significand be the String value consisting of the digits of the decimal representation of intSignificand (in order, with no leading zeroes). If fractionCount ≠ 0, then Let intPart be the first code unit of significand. Let fractionalPart be the other fractionCount code units of significand. Set significand to the string-concatenation of intPart, ".", and fractionalPart. If exponent = 0, then Let exponentSign be "+". Let exponentDigits be "0". Else, If exponent > 0, then Let exponentSign be "+". Else, Assert: exponent < 0. Let exponentSign be "-". Set exponent to -exponent. Let exponentDigits be the String value consisting of the digits of the decimal representation of exponent (in order, with no leading zeroes). Set significand to the string-concatenation of significand, "e", exponentSign, and exponentDigits. Return the string-concatenation of sign and significand. Note For implementations that provide more accurate conversions than required by the rules above, it is recommended that the following alternative version of step 11.b.i be used as a guideline: Let exponent, intSignificand, and ff be integers such that ff ≥ 0, 10ff ≤ intSignificand < 10ff + 1, 𝔽(intSignificand × 10exponent - ff) is 𝔽(number), and ff is as small as possible. If there are multiple possibilities for intSignificand, choose intSignificand such that 𝔽(intSignificand × 10exponent - ff) is closest to 𝔽(number). If there are two such possible values of intSignificand, choose the one that is even. 21.1.3.3 Number.prototype.toFixed ( fractionDigits ) Note 1 This method returns a String containing this Number value represented in decimal fixed-point notation with fractionDigits digits after the decimal point. If fractionDigits is undefined, 0 is assumed. It performs the following steps when called: Let number be ? ThisNumberValue(this value). Let fractionCount be ? ToIntegerOrInfinity(fractionDigits). Assert: If fractionDigits is undefined, then fractionCount is 0. If fractionCount is not an integer, throw a RangeError exception. If fractionCount < 0 or fractionCount > 100, throw a RangeError exception. If number is not a finite Number, return Number::toString(number, 10). Set number to ℝ(number). Let sign be the empty String. If number < 0, then Set sign to "-". Set number to -number. If number ≥ 1021, then Let digitString be ! ToString(𝔽(number)). Else, Let intValue be an integer for which intValue / 10fractionCount - number is as close to zero as possible. If there are two such intValue, pick the larger intValue. If intValue = 0, let digitString be "0"; else let digitString be the String value consisting of the digits of the decimal representation of intValue (in order, with no leading zeroes). If fractionCount ≠ 0, then Let digitCount be the length of digitString. If digitCount ≤ fractionCount, then Let zeroPad be the String value consisting of fractionCount + 1 - digitCount occurrences of the code unit 0x0030 (DIGIT ZERO). Set digitString to the string-concatenation of zeroPad and digitString. Set digitCount to fractionCount + 1. Let intPart be the first digitCount - fractionCount code units of digitString. Let fractionalPart be the other fractionCount code units of digitString. Set digitString to the string-concatenation of intPart, ".", and fractionalPart. Return the string-concatenation of sign and digitString. Note 2 The output of toFixed may be more precise than toString for some values because toString only prints enough significant digits to distinguish the number from adjacent Number values. For example, (1000000000000000128).toString() returns "1000000000000000100", while (1000000000000000128).toFixed(0) returns "1000000000000000128". 21.1.3.4 Number.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] ) An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in ECMA-402. Otherwise, the following specification of this method is used: This method produces a String value that represents this Number value formatted according to the conventions of the host environment's current locale. This method is implementation-defined, and it is permissible, but not encouraged, for it to return the same thing as toString. The meanings of the optional parameters to this method are defined in ECMA-402; implementations that do not include ECMA-402 support must not use those parameter positions for anything else. 21.1.3.5 Number.prototype.toPrecision ( precision ) This method returns a String containing this Number value represented either in decimal exponential notation with one digit before the significand's decimal point and precision - 1 digits after the significand's decimal point or in decimal fixed notation with precision significant digits. If precision is undefined, it calls ToString instead. It performs the following steps when called: Let number be ? ThisNumberValue(this value). If precision is undefined, return ! ToString(number). Let precisionCount be ? ToIntegerOrInfinity(precision). If number is not a finite Number, return Number::toString(number, 10). If precisionCount is not an integer, throw a RangeError exception. If precisionCount < 1 or precisionCount > 100, throw a RangeError exception. Set number to ℝ(number). Let sign be the empty String. If number < 0, then Set sign to the code unit 0x002D (HYPHEN-MINUS). Set number to -number. If number = 0, then Let significand be the String value consisting of precisionCount occurrences of the code unit 0x0030 (DIGIT ZERO). Let exponent be 0. Else, Let exponent and intSignificand be integers such that 10precisionCount - 1 ≤ intSignificand < 10precisionCount and for which intSignificand × 10exponent - precisionCount + 1 - number is as close to zero as possible. If there are two such sets of exponent and intSignificand, pick the exponent and intSignificand for which intSignificand × 10exponent - precisionCount + 1 is larger. Let significand be the String value consisting of the digits of the decimal representation of intSignificand (in order, with no leading zeroes). If exponent < -6 or exponent ≥ precisionCount, then Assert: exponent ≠ 0. If precisionCount ≠ 1, then Let intPart be the first code unit of significand. Let fractionalPart be the other precisionCount - 1 code units of significand. Set significand to the string-concatenation of intPart, ".", and fractionalPart. If exponent > 0, then Let exponentSign be the code unit 0x002B (PLUS SIGN). Else, Assert: exponent < 0. Let exponentSign be the code unit 0x002D (HYPHEN-MINUS). Set exponent to -exponent. Let exponentDigits be the String value consisting of the digits of the decimal representation of exponent (in order, with no leading zeroes). Return the string-concatenation of sign, significand, the code unit 0x0065 (LATIN SMALL LETTER E), exponentSign, and exponentDigits. If exponent = precisionCount - 1, return the string-concatenation of sign and significand. If exponent ≥ 0, then Set significand to the string-concatenation of the first exponent + 1 code units of significand, the code unit 0x002E (FULL STOP), and the remaining precisionCount - (exponent + 1) code units of significand. Else, Set significand to the string-concatenation of the code unit 0x0030 (DIGIT ZERO), the code unit 0x002E (FULL STOP), -(exponent + 1) occurrences of the code unit 0x0030 (DIGIT ZERO), and the String significand. Return the string-concatenation of sign and significand. 21.1.3.6 Number.prototype.toString ( [ radix ] ) Note The optional radix should be an integral Number value in the inclusive interval from 2𝔽 to 36𝔽. If radix is undefined then 10𝔽 is used as the value of radix. This method performs the following steps when called: Let x be ? ThisNumberValue(this value). If radix is undefined, let radixMV be 10. Else, let radixMV be ? SnapToInteger(radix, truncate, 2, 36). Return Number::toString(x, radixMV). This method is not generic; it throws a TypeError exception if its this value is not a Number or a Number object. Therefore, it cannot be transferred to other kinds of objects for use as a method. The "length" property of this method is 1𝔽. 21.1.3.7 Number.prototype.valueOf ( ) Return ? ThisNumberValue(this value). 21.1.3.7.1 ThisNumberValue ( arg ) The abstract operation ThisNumberValue takes argument arg (an ECMAScript language value) and returns either a normal completion containing a Number or a throw completion. It performs the following steps when called: If arg is a Number, return arg. If arg is an Object and arg has a [[NumberData]] internal slot, then Let number be arg.[[NumberData]]. Assert: number is a Number. Return number. Throw a TypeError exception. 21.1.4 Properties of Number Instances Number instances are ordinary objects that inherit properties from the Number prototype object. Number instances also have a [[NumberData]] internal slot. The [[NumberData]] internal slot is the Number value represented by this Number object. 21.2 BigInt Objects 21.2.1 The BigInt Constructor The BigInt constructor: is %BigInt%. is the initial value of the "BigInt" property of the global object. performs a type conversion when called as a function rather than as a constructor. is not intended to be used with the new operator or to be subclassed. It may be used as the value of an extends clause of a class definition but a super call to the BigInt constructor will cause an exception. 21.2.1.1 BigInt ( value ) This function performs the following steps when called: If NewTarget is not undefined, throw a TypeError exception. Let primitive be ? ToPrimitive(value, number). If primitive is a Number, return ? NumberToBigInt(primitive). Return ? ToBigInt(primitive). 21.2.1.1.1 NumberToBigInt ( number ) The abstract operation NumberToBigInt takes argument number (a Number) and returns either a normal completion containing a BigInt or a throw completion. It performs the following steps when called: If number is not an integral Number, throw a RangeError exception. Return ℤ(ℝ(number)). 21.2.2 Properties of the BigInt Constructor The BigInt constructor: has a [[Prototype]] internal slot whose value is %Function.prototype%. has the following properties: 21.2.2.1 BigInt.asIntN ( bits, bigint ) This function performs the following steps when called: Set bits to ? ToIndex(bits). Set bigint to ? ToBigInt(bigint). Let remainder be ℝ(bigint) modulo 2bits. If remainder ≥ 2bits - 1, return ℤ(remainder - 2bits). Return ℤ(remainder). 21.2.2.2 BigInt.asUintN ( bits, bigint ) This function performs the following steps when called: Set bits to ? ToIndex(bits). Set bigint to ? ToBigInt(bigint). Return ℤ(ℝ(bigint) modulo 2bits). 21.2.2.3 BigInt.prototype The initial value of BigInt.prototype is the BigInt prototype object. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.2.3 Properties of the BigInt Prototype Object The BigInt prototype object: is %BigInt.prototype%. is an ordinary object. is not a BigInt object; it does not have a [[BigIntData]] internal slot. has a [[Prototype]] internal slot whose value is %Object.prototype%. The phrase “this BigInt value” within the specification of a method refers to the result returned by calling the abstract operation ThisBigIntValue with the this value of the method invocation passed as the argument. 21.2.3.1 BigInt.prototype.constructor The initial value of BigInt.prototype.constructor is %BigInt%. 21.2.3.2 BigInt.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] ) An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in ECMA-402. Otherwise, the following specification of this method is used: This method produces a String value that represents this BigInt value formatted according to the conventions of the host environment's current locale. This method is implementation-defined, and it is permissible, but not encouraged, for it to return the same thing as toString. The meanings of the optional parameters to this method are defined in ECMA-402; implementations that do not include ECMA-402 support must not use those parameter positions for anything else. 21.2.3.3 BigInt.prototype.toString ( [ radix ] ) Note The optional radix should be an integral Number value in the inclusive interval from 2𝔽 to 36𝔽. If radix is undefined then 10𝔽 is used as the value of radix. This method performs the following steps when called: Let x be ? ThisBigIntValue(this value). If radix is undefined, let radixMV be 10. Else, let radixMV be ? SnapToInteger(radix, truncate, 2, 36). Return BigInt::toString(x, radixMV). This method is not generic; it throws a TypeError exception if its this value is not a BigInt or a BigInt object. Therefore, it cannot be transferred to other kinds of objects for use as a method. 21.2.3.4 BigInt.prototype.valueOf ( ) Return ? ThisBigIntValue(this value). 21.2.3.4.1 ThisBigIntValue ( arg ) The abstract operation ThisBigIntValue takes argument arg (an ECMAScript language value) and returns either a normal completion containing a BigInt or a throw completion. It performs the following steps when called: If arg is a BigInt, return arg. If arg is an Object and arg has a [[BigIntData]] internal slot, then Assert: arg.[[BigIntData]] is a BigInt. Return arg.[[BigIntData]]. Throw a TypeError exception. 21.2.3.5 BigInt.prototype [ %Symbol.toStringTag% ] The initial value of the %Symbol.toStringTag% property is the String value "BigInt". This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. 21.2.4 Properties of BigInt Instances BigInt instances are ordinary objects that inherit properties from the BigInt prototype object. BigInt instances also have a [[BigIntData]] internal slot. The [[BigIntData]] internal slot is the BigInt value represented by this BigInt object. 21.3 The Math Object The Math object: is %Math%. is the initial value of the "Math" property of the global object. is an ordinary object. has a [[Prototype]] internal slot whose value is %Object.prototype%. is not a function object. does not have a [[Construct]] internal method; it cannot be used as a constructor with the new operator. does not have a [[Call]] internal method; it cannot be invoked as a function. Note In this specification, the phrase “the Number value for x” has a technical meaning defined in 6.1.6.1. 21.3.1 Value Properties of the Math Object 21.3.1.1 Math.E The Number value for e, the base of the natural logarithms, which is approximately 2.7182818284590452354. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.3.1.2 Math.LN10 The Number value for the natural logarithm of 10, which is approximately 2.302585092994046. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.3.1.3 Math.LN2 The Number value for the natural logarithm of 2, which is approximately 0.6931471805599453. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.3.1.4 Math.LOG10E The Number value for the base-10 logarithm of e, the base of the natural logarithms; this value is approximately 0.4342944819032518. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. Note The value of Math.LOG10E is approximately the reciprocal of the value of Math.LN10. 21.3.1.5 Math.LOG2E The Number value for the base-2 logarithm of e, the base of the natural logarithms; this value is approximately 1.4426950408889634. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. Note The value of Math.LOG2E is approximately the reciprocal of the value of Math.LN2. 21.3.1.6 Math.PI The Number value for π, the ratio of the circumference of a circle to its diameter, which is approximately 3.1415926535897932. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.3.1.7 Math.SQRT1_2 The Number value for the square root of ½, which is approximately 0.7071067811865476. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. Note The value of Math.SQRT1_2 is approximately the reciprocal of the value of Math.SQRT2. 21.3.1.8 Math.SQRT2 The Number value for the square root of 2, which is approximately 1.4142135623730951. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.3.1.9 Math [ %Symbol.toStringTag% ] The initial value of the %Symbol.toStringTag% property is the String value "Math". This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. 21.3.2 Function Properties of the Math Object Note The behaviour of the functions acos, acosh, asin, asinh, atan, atanh, atan2, cbrt, cos, cosh, exp, expm1, hypot, log, log1p, log2, log10, pow, random, sin, sinh, tan, and tanh is not precisely specified here except to require specific results for certain argument values that represent boundary cases of interest. For other argument values, these functions are intended to compute approximations to the results of familiar mathematical functions, but some latitude is allowed in the choice of approximation algorithms. The general intent is that an implementer should be able to use the same mathematical library for ECMAScript on a given hardware platform that is available to C programmers on that platform. Although the choice of algorithms is left to the implementation, it is recommended (but not specified by this standard) that implementations use the approximation algorithms for IEEE 754-2019 arithmetic contained in fdlibm, the freely distributable mathematical library from Sun Microsystems (http://www.netlib.org/fdlibm). 21.3.2.1 Math.abs ( x ) This function returns the absolute value of x; the result has the same magnitude as x but has positive sign. It performs the following steps when called: Let n be ? ToNumber(x). If n is NaN, return NaN. If n is -0𝔽, return +0𝔽. If n is -∞𝔽, return +∞𝔽. If n < -0𝔽, return -n. Return n. 21.3.2.2 Math.acos ( x ) This function returns the inverse cosine of x. The result is expressed in radians and is in the inclusive interval from +0𝔽 to 𝔽(π). It performs the following steps when called: Let n be ? ToNumber(x). If n is NaN, n > 1𝔽, or n < -1𝔽, return NaN. If n is 1𝔽, return +0𝔽. Return an implementation-approximated Number value representing the inverse cosine of ℝ(n). 21.3.2.3 Math.acosh ( x ) This function returns the inverse hyperbolic cosine of x. It performs the following steps when called: Let n be ? ToNumber(x). If n is either NaN or +∞𝔽, return n. If n is 1𝔽, return +0𝔽. If n < 1𝔽, return NaN. Return an implementation-approximated Number value representing the inverse hyperbolic cosine of ℝ(n). 21.3.2.4 Math.asin ( x ) This function returns the inverse sine of x. The result is expressed in radians and is in the inclusive interval from 𝔽(-π / 2) to 𝔽(π / 2). It performs the following steps when called: Let n be ? ToNumber(x). If n is one of NaN, +0𝔽, or -0𝔽, return n. If n > 1𝔽 or n < -1𝔽, return NaN. Return an implementation-approximated Number value representing the inverse sine of ℝ(n). 21.3.2.5 Math.asinh ( x ) This function returns the inverse hyperbolic sine of x. It performs the following steps when called: Let n be ? ToNumber(x). If n is not a finite Number or n is either +0𝔽 or -0𝔽, return n. Return an implementation-approximated Number value representing the inverse hyperbolic sine of ℝ(n). 21.3.2.6 Math.atan ( x ) This function returns the inverse tangent of x. The result is expressed in radians and is in the inclusive interval from 𝔽(-π / 2) to 𝔽(π / 2). It performs the following steps when called: Let n be ? ToNumber(x). If n is one of NaN, +0𝔽, or -0𝔽, return n. If n is +∞𝔽, return an implementation-approximated Number value representing π / 2. If n is -∞𝔽, return an implementation-approximated Number value representing -π / 2. Return an implementation-approximated Number value representing the inverse tangent of ℝ(n). 21.3.2.7 Math.atanh ( x ) This function returns the inverse hyperbolic tangent of x. It performs the following steps when called: Let n be ? ToNumber(x). If n is one of NaN, +0𝔽, or -0𝔽, return n. If n > 1𝔽 or n < -1𝔽, return NaN. If n is 1𝔽, return +∞𝔽. If n is -1𝔽, return -∞𝔽. Return an implementation-approximated Number value representing the inverse hyperbolic tangent of ℝ(n). 21.3.2.8 Math.atan2 ( y, x ) This function returns the inverse tangent of the quotient y / x of the arguments y and x, where the signs of y and x are used to determine the quadrant of the result. Note that it is intentional and traditional for the two-argument inverse tangent function that the argument named y be first and the argument named x be second. The result is expressed in radians and is in the inclusive interval from -π to +π. It performs the following steps when called: Let ny be ? ToNumber(y). Let nx be ? ToNumber(x). If ny is NaN or nx is NaN, return NaN. If ny is +∞𝔽, then If nx is +∞𝔽, return an implementation-approximated Number value representing π / 4. If nx is -∞𝔽, return an implementation-approximated Number value representing 3π / 4. Return an implementation-approximated Number value representing π / 2. If ny is -∞𝔽, then If nx is +∞𝔽, return an implementation-approximated Number value representing -π / 4. If nx is -∞𝔽, return an implementation-approximated Number value representing -3π / 4. Return an implementation-approximated Number value representing -π / 2. If ny is +0𝔽, then If nx > +0𝔽 or nx is +0𝔽, return +0𝔽. Return an implementation-approximated Number value representing π. If ny is -0𝔽, then If nx > +0𝔽 or nx is +0𝔽, return -0𝔽. Return an implementation-approximated Number value representing -π. Assert: ny is a finite Number and is neither +0𝔽 nor -0𝔽. If ny > +0𝔽, then If nx is +∞𝔽, return +0𝔽. If nx is -∞𝔽, return an implementation-approximated Number value representing π. If nx is either +0𝔽 or -0𝔽, return an implementation-approximated Number value representing π / 2. If ny < -0𝔽, then If nx is +∞𝔽, return -0𝔽. If nx is -∞𝔽, return an implementation-approximated Number value representing -π. If nx is either +0𝔽 or -0𝔽, return an implementation-approximated Number value representing -π / 2. Assert: nx is a finite Number and is neither +0𝔽 nor -0𝔽. Let result be the inverse tangent of abs(ℝ(ny) / ℝ(nx)). If nx < -0𝔽, then If ny > +0𝔽, set result to π - result. Else, set result to -π + result. Else, If ny < -0𝔽, set result to -result. Return an implementation-approximated Number value representing result. 21.3.2.9 Math.cbrt ( x ) This function returns the cube root of x. It performs the following steps when called: Let n be ? ToNumber(x). If n is not a finite Number or n is either +0𝔽 or -0𝔽, return n. Return an implementation-approximated Number value representing the cube root of ℝ(n). 21.3.2.10 Math.ceil ( x ) This function returns the smallest (closest to -∞) integral Number value that is not less than x. If x is already an integral Number, the result is x. It performs the following steps when called: Let n be ? ToNumber(x). If n is not a finite Number or n is either +0𝔽 or -0𝔽, return n. If n < -0𝔽 and n > -1𝔽, return -0𝔽. If n is an integral Number, return n. Return the smallest (closest to -∞) integral Number value that is not less than n. Note The value of Math.ceil(x) is the same as the value of -Math.floor(-x). 21.3.2.11 Math.clz32 ( x ) This function performs the following steps when called: Let n be ? ToUint32(x). Let p be the number of leading zero bits in the unsigned 32-bit binary representation of n. Return 𝔽(p). Note If n is either +0𝔽 or -0𝔽, this method returns 32𝔽. If the most significant bit of the 32-bit binary encoding of n is 1, this method returns +0𝔽. 21.3.2.12 Math.cos ( x ) This function returns the cosine of x. The argument is expressed in radians. It performs the following steps when called: Let n be ? ToNumber(x). If n is not a finite Number, return NaN. If n is either +0𝔽 or -0𝔽, return 1𝔽. Return an implementation-approximated Number value representing the cosine of ℝ(n). 21.3.2.13 Math.cosh ( x ) This function returns the hyperbolic cosine of x. It performs the following steps when called: Let n be ? ToNumber(x). If n is NaN, return NaN. If n is either +∞𝔽 or -∞𝔽, return +∞𝔽. If n is either +0𝔽 or -0𝔽, return 1𝔽. Return an implementation-approximated Number value representing the hyperbolic cosine of ℝ(n). Note The value of Math.cosh(x) is the same as the value of (Math.exp(x) + Math.exp(-x)) / 2. 21.3.2.14 Math.exp ( x ) This function returns the exponential function of x (e raised to the power of x, where e is the base of the natural logarithms). It performs the following steps when called: Let n be ? ToNumber(x). If n is either NaN or +∞𝔽, return n. If n is either +0𝔽 or -0𝔽, return 1𝔽. If n is -∞𝔽, return +0𝔽. Return an implementation-approximated Number value representing the exponential function of ℝ(n). 21.3.2.15 Math.expm1 ( x ) This function returns the result of subtracting 1 from the exponential function of x (e raised to the power of x, where e is the base of the natural logarithms). The result is computed in a way that is accurate even when the value of x is close to 0. It performs the following steps when called: Let n be ? ToNumber(x). If n is one of NaN, +0𝔽, -0𝔽, or +∞𝔽, return n. If n is -∞𝔽, return -1𝔽. Let exp be the exponential function of ℝ(n). Return an implementation-approximated Number value representing exp - 1. 21.3.2.16 Math.floor ( x ) This function returns the greatest (closest to +∞) integral Number value that is not greater than x. If x is already an integral Number, the result is x. It performs the following steps when called: Let n be ? ToNumber(x). If n is not a finite Number or n is either +0𝔽 or -0𝔽, return n. If n < 1𝔽 and n > +0𝔽, return +0𝔽. If n is an integral Number, return n. Return the greatest (closest to +∞) integral Number value that is not greater than n. Note The value of Math.floor(x) is the same as the value of -Math.ceil(-x). 21.3.2.17 Math.fround ( x ) This function performs the following steps when called: Let n be ? ToNumber(x). If n is NaN, return NaN. If n is one of +0𝔽, -0𝔽, +∞𝔽, or -∞𝔽, return n. Let n32 be the result of converting n to IEEE 754-2019 binary32 format using roundTiesToEven mode. Let n64 be the result of converting n32 to IEEE 754-2019 binary64 format. Return the ECMAScript Number value corresponding to n64. 21.3.2.18 Math.f16round ( x ) This function performs the following steps when called: Let n be ? ToNumber(x). If n is NaN, return NaN. If n is one of +0𝔽, -0𝔽, +∞𝔽, or -∞𝔽, return n. Let n16 be the result of converting n to IEEE 754-2019 binary16 format using roundTiesToEven mode. Let n64 be the result of converting n16 to IEEE 754-2019 binary64 format. Return the ECMAScript Number value corresponding to n64. Note This operation is not the same as casting to binary32 and then to binary16 because of the possibility of double-rounding: consider the number k = 1.00048828125000022204𝔽, for example, for which Math.f16round(k) is 1.0009765625𝔽, but Math.f16round(Math.fround(k)) is 1𝔽. Not all platforms provide native support for casting from binary64 to binary16. There are various libraries which can provide this, including the MIT-licensed half library. Alternatively, it is possible to first cast from binary64 to binary32 under roundTiesToEven and then check whether the result could lead to incorrect double-rounding. Such cases can be handled explicitly by adjusting the mantissa of the binary32 value so that it is the value which would be produced by performing the initial cast under roundTiesToOdd. Casting the adjusted value to binary16 under roundTiesToEven then produces the correct value. 21.3.2.19 Math.hypot ( ...args ) Given zero or more arguments, this function returns the square root of the sum of squares of its arguments. It performs the following steps when called: Let coerced be a new empty List. For each element arg of args, do Let n be ? ToNumber(arg). Append n to coerced. For each element number of coerced, do If number is either +∞𝔽 or -∞𝔽, return +∞𝔽. Let onlyZero be true. For each element number of coerced, do If number is NaN, return NaN. If number is neither +0𝔽 nor -0𝔽, set onlyZero to false. If onlyZero is true, return +0𝔽. Return an implementation-approximated Number value representing the square root of the sum of squares of the mathematical values of the elements of coerced. The "length" property of this function is 2𝔽. Note Implementations should take care to avoid the loss of precision from overflows and underflows that are prone to occur in naive implementations when this function is called with two or more arguments. 21.3.2.20 Math.imul ( x, y ) This function performs the following steps when called: Let a be ℝ(? ToUint32(x)). Let b be ℝ(? ToUint32(y)). Let product be (a × b) modulo 232. If product ≥ 231, return 𝔽(product - 232). Return 𝔽(product). 21.3.2.21 Math.log ( x ) This function returns the natural logarithm of x. It performs the following steps when called: Let n be ? ToNumber(x). If n is either NaN or +∞𝔽, return n. If n is 1𝔽, return +0𝔽. If n is either +0𝔽 or -0𝔽, return -∞𝔽. If n < -0𝔽, return NaN. Return an implementation-approximated Number value representing ln(ℝ(n)). 21.3.2.22 Math.log1p ( x ) This function returns the natural logarithm of 1 + x. The result is computed in a way that is accurate even when the value of x is close to zero. It performs the following steps when called: Let n be ? ToNumber(x). If n is one of NaN, +0𝔽, -0𝔽, or +∞𝔽, return n. If n is -1𝔽, return -∞𝔽. If n < -1𝔽, return NaN. Return an implementation-approximated Number value representing ln(1 + ℝ(n)). 21.3.2.23 Math.log10 ( x ) This function returns the base 10 logarithm of x. It performs the following steps when called: Let n be ? ToNumber(x). If n is either NaN or +∞𝔽, return n. If n is 1𝔽, return +0𝔽. If n is either +0𝔽 or -0𝔽, return -∞𝔽. If n < -0𝔽, return NaN. Return an implementation-approximated Number value representing log10(ℝ(n)). 21.3.2.24 Math.log2 ( x ) This function returns the base 2 logarithm of x. It performs the following steps when called: Let n be ? ToNumber(x). If n is either NaN or +∞𝔽, return n. If n is 1𝔽, return +0𝔽. If n is either +0𝔽 or -0𝔽, return -∞𝔽. If n < -0𝔽, return NaN. Return an implementation-approximated Number value representing log2(ℝ(n)). 21.3.2.25 Math.max ( ...args ) Given zero or more arguments, this function calls ToNumber on each of the arguments and returns the largest of the resulting values. It performs the following steps when called: Let coerced be a new empty List. For each element arg of args, do Let n be ? ToNumber(arg). Append n to coerced. Let highest be -∞𝔽. For each element number of coerced, do If number is NaN, return NaN. If number is +0𝔽 and highest is -0𝔽, set highest to +0𝔽. If number > highest, set highest to number. Return highest. Note The comparison of values to determine the largest value is done using the IsLessThan algorithm except that +0𝔽 is considered to be larger than -0𝔽. The "length" property of this function is 2𝔽. 21.3.2.26 Math.min ( ...args ) Given zero or more arguments, this function calls ToNumber on each of the arguments and returns the smallest of the resulting values. It performs the following steps when called: Let coerced be a new empty List. For each element arg of args, do Let n be ? ToNumber(arg). Append n to coerced. Let lowest be +∞𝔽. For each element number of coerced, do If number is NaN, return NaN. If number is -0𝔽 and lowest is +0𝔽, set lowest to -0𝔽. If number < lowest, set lowest to number. Return lowest. Note The comparison of values to determine the smallest value is done using the IsLessThan algorithm except that +0𝔽 is considered to be larger than -0𝔽. The "length" property of this function is 2𝔽. 21.3.2.27 Math.pow ( base, exponent ) This function performs the following steps when called: Set base to ? ToNumber(base). Set exponent to ? ToNumber(exponent). Return Number::exponentiate(base, exponent). 21.3.2.28 Math.random ( ) This function returns a Number value with positive sign, greater than or equal to +0𝔽 but strictly less than 1𝔽, chosen randomly or pseudo randomly with approximately uniform distribution over that range, using an implementation-defined algorithm or strategy. Each Math.random function created for distinct realms must produce a distinct sequence of values from successive calls. 21.3.2.29 Math.round ( x ) This function returns the Number value that is closest to x and is integral. If two integral Numbers are equally close to x, then the result is the Number value that is closer to +∞. If x is already integral, the result is x. It performs the following steps when called: Let n be ? ToNumber(x). If n is not a finite Number or n is an integral Number, return n. If n < 0.5𝔽 and n > +0𝔽, return +0𝔽. If n < -0𝔽 and n ≥ -0.5𝔽, return -0𝔽. Return the integral Number closest to n, preferring the Number closer to +∞ in the case of a tie. Note 1 Math.round(3.5) returns 4, but Math.round(-3.5) returns -3. Note 2 The value of Math.round(x) is not always the same as the value of Math.floor(x + 0.5). When x is -0𝔽 or x is less than -0𝔽 but greater than or equal to -0.5𝔽, Math.round(x) returns -0𝔽, but Math.floor(x + 0.5) returns +0𝔽. Math.round(x) may also differ from the value of Math.floor(x + 0.5)because of internal rounding when computing x + 0.5. 21.3.2.30 Math.sign ( x ) This function returns the sign of x, indicating whether x is positive, negative, or zero. It performs the following steps when called: Let n be ? ToNumber(x). If n is one of NaN, +0𝔽, or -0𝔽, return n. If n < -0𝔽, return -1𝔽. Return 1𝔽. 21.3.2.31 Math.sin ( x ) This function returns the sine of x. The argument is expressed in radians. It performs the following steps when called: Let n be ? ToNumber(x). If n is one of NaN, +0𝔽, or -0𝔽, return n. If n is either +∞𝔽 or -∞𝔽, return NaN. Return an implementation-approximated Number value representing the sine of ℝ(n). 21.3.2.32 Math.sinh ( x ) This function returns the hyperbolic sine of x. It performs the following steps when called: Let n be ? ToNumber(x). If n is not a finite Number or n is either +0𝔽 or -0𝔽, return n. Return an implementation-approximated Number value representing the hyperbolic sine of ℝ(n). Note The value of Math.sinh(x) is the same as the value of (Math.exp(x) - Math.exp(-x)) / 2. 21.3.2.33 Math.sqrt ( x ) This function returns the square root of x. It performs the following steps when called: Let n be ? ToNumber(x). If n is one of NaN, +0𝔽, -0𝔽, or +∞𝔽, return n. If n < -0𝔽, return NaN. Return 𝔽(the square root of ℝ(n)). 21.3.2.34 Math.sumPrecise ( items ) Given an iterable of Numbers, this function sums each value in the iterable and returns their sum. If any value is not a Number it throws a TypeError exception. It performs the following steps when called: Perform ? RequireObjectCoercible(items). Let iteratorRecord be ? GetIterator(items, sync). Let state be minus-zero. Let sum be 0. Let count be 0. Let next be not-started. Repeat, while next is not done, Set next to ? IteratorStepValue(iteratorRecord). If next is not done, then If count ≥ 253 - 1, then NOTE: This step is not expected to be reached in practice and is included only so that implementations may rely on inputs being “reasonably sized” without violating this specification. Let error be ThrowCompletion(a newly created RangeError object). Return ? IteratorClose(iteratorRecord, error). If next is not a Number, then Let error be ThrowCompletion(a newly created TypeError object). Return ? IteratorClose(iteratorRecord, error). Let n be next. If state is not not-a-number, then If n is NaN, then Set state to not-a-number. Else if n is +∞𝔽, then If state is minus-infinity, set state to not-a-number. Else, set state to plus-infinity. Else if n is -∞𝔽, then If state is plus-infinity, set state to not-a-number. Else, set state to minus-infinity. Else if n is not -0𝔽 and state is either minus-zero or finite, then Set state to finite. Set sum to sum + ℝ(n). Set count to count + 1. If state is not-a-number, return NaN. If state is plus-infinity, return +∞𝔽. If state is minus-infinity, return -∞𝔽. If state is minus-zero, return -0𝔽. Return 𝔽(sum). Note The value of sum can be computed without arbitrary-precision arithmetic by a variety of algorithms. One such is the “Grow-Expansion” algorithm given in Adaptive Precision Floating-Point Arithmetic and Fast Robust Geometric Predicates by Jonathan Richard Shewchuk. A more recent algorithm is given in “Fast exact summation using small and large superaccumulators”, code for which is available at https://gitlab.com/radfordneal/xsum. 21.3.2.35 Math.tan ( x ) This function returns the tangent of x. The argument is expressed in radians. It performs the following steps when called: Let n be ? ToNumber(x). If n is one of NaN, +0𝔽, or -0𝔽, return n. If n is either +∞𝔽 or -∞𝔽, return NaN. Return an implementation-approximated Number value representing the tangent of ℝ(n). 21.3.2.36 Math.tanh ( x ) This function returns the hyperbolic tangent of x. It performs the following steps when called: Let n be ? ToNumber(x). If n is one of NaN, +0𝔽, or -0𝔽, return n. If n is +∞𝔽, return 1𝔽. If n is -∞𝔽, return -1𝔽. Return an implementation-approximated Number value representing the hyperbolic tangent of ℝ(n). Note The value of Math.tanh(x) is the same as the value of (Math.exp(x) - Math.exp(-x)) / (Math.exp(x) + Math.exp(-x)). 21.3.2.37 Math.trunc ( x ) This function returns the integral part of the number x, removing any fractional digits. If x is already integral, the result is x. It performs the following steps when called: Let n be ? ToNumber(x). If n is not a finite Number or n is either +0𝔽 or -0𝔽, return n. If n < 1𝔽 and n > +0𝔽, return +0𝔽. If n < -0𝔽 and n > -1𝔽, return -0𝔽. Return the integral Number nearest n in the direction of +0𝔽. 21.4 Date Objects 21.4.1 Overview of Date Objects and Definitions of Abstract Operations The following abstract operations operate on time values (defined in 21.4.1.1). Note that, in every case, if any argument to one of these functions is NaN, the result will be NaN. 21.4.1.1 Time Values and Time Range Time measurement in ECMAScript is analogous to time measurement in POSIX, in particular sharing definition in terms of the proleptic Gregorian calendar, an epoch of midnight at the beginning of 1 January 1970 UTC, and an accounting of every day as comprising exactly 86,400 seconds (each of which is 1000 milliseconds long). An ECMAScript time value is a Number, either an integral Number representing an instant in time to millisecond precision (referred to as a finite time value) or NaN representing no specific instant. A finite time value that is an integer multiple of MillisecondsPerDay (i.e., is MillisecondsPerDay × d for some integer d) represents the instant at the start of the UTC day that follows the epoch by d whole UTC days (preceding the epoch for negative d). Every other finite time value tv is defined relative to the greatest preceding finite time value s that is such a multiple, and represents the instant that occurs within the same UTC day as s but follows it by (tv - s) milliseconds. Time values do not account for UTC leap seconds—there are no time values representing instants within positive leap seconds, and there are time values representing instants removed from the UTC timeline by negative leap seconds. However, the definition of time values nonetheless yields piecewise alignment with UTC, with discontinuities only at leap second boundaries and zero difference outside of leap seconds. A Number can exactly represent all integers from -9,007,199,254,740,992 to 9,007,199,254,740,992 (21.1.2.8 and 21.1.2.6). A time value supports a slightly smaller range of -8,640,000,000,000,000 to 8,640,000,000,000,000 milliseconds. This yields a supported time value range of exactly -100,000,000 days to 100,000,000 days relative to midnight at the beginning of 1 January 1970 UTC. The exact moment of midnight at the beginning of 1 January 1970 UTC is represented by the time value +0𝔽. Note In the proleptic Gregorian calendar, leap years are precisely those which are both divisible by 4 and either divisible by 400 or not divisible by 100. The 400 year cycle of the proleptic Gregorian calendar contains 97 leap years. This yields an average of 365.2425 days per year, which is 31,556,952,000 milliseconds. Therefore, the maximum range a Number could represent exactly with millisecond precision is approximately -285,426 to 285,426 years relative to 1970. The smaller range supported by a time value as specified in this section is approximately -273,790 to 273,790 years relative to 1970. 21.4.1.2 Time-related Constants These constants are referenced by algorithms in the following sections. HoursPerDay = 24 MinutesPerHour = 60 SecondsPerMinute = 60 MillisecondsPerSecond = 1000 MillisecondsPerMinute = 60000 = MillisecondsPerSecond × SecondsPerMinute MillisecondsPerHour = 3600000 = MillisecondsPerMinute × MinutesPerHour MillisecondsPerDay = 86400000 = MillisecondsPerHour × HoursPerDay NanosecondsPerDay = 106 × MillisecondsPerDay = 8.64 × 1013 NanosecondsPerSecond = 106 × MillisecondsPerSecond = 109 NanosecondsPerMillisecond = 106 NanosecondsPerMicrosecond = 103 MaxEpochNanoseconds = 108 × NanosecondsPerDay = 8.64 × 1021 MinEpochNanoseconds = -MaxEpochNanoseconds = -8.64 × 1021 21.4.1.3 Day ( tv ) The abstract operation Day takes argument tv (a finite time value) and returns an integer. It returns the day number of the day in which tv falls. It performs the following steps when called: Return floor(ℝ(tv) / MillisecondsPerDay). 21.4.1.4 TimeWithinDay ( tv ) The abstract operation TimeWithinDay takes argument tv (a finite time value) and returns an integer in the interval from 0 (inclusive) to MillisecondsPerDay (exclusive). It returns the number of milliseconds since the start of the day in which tv falls. It performs the following steps when called: Return ℝ(tv) modulo MillisecondsPerDay. 21.4.1.5 DayFromYear ( y ) The abstract operation DayFromYear takes argument y (an integer) and returns an integer. It returns the day number of the first day of year y. It performs the following steps when called: NOTE: In the following steps, numberYears1, numberYears4, numberYears100, and numberYears400 represent the number of years divisible by 1, 4, 100, and 400, respectively, that occur between the epoch and the start of year y. The number is negative if y is before the epoch. Let numberYears1 be (y - 1970). Let numberYears4 be floor((y - 1969) / 4). Let numberYears100 be floor((y - 1901) / 100). Let numberYears400 be floor((y - 1601) / 400). Return 365 × numberYears1 + numberYears4 - numberYears100 + numberYears400. 21.4.1.6 TimeFromYear ( y ) The abstract operation TimeFromYear takes argument y (an integer) and returns a time value. It returns the time value of the start of year y. It performs the following steps when called: Return 𝔽(MillisecondsPerDay × DayFromYear(y)). 21.4.1.7 YearFromTime ( tv ) The abstract operation YearFromTime takes argument tv (a finite time value) and returns an integer. It returns the year in which tv falls. It performs the following steps when called: Return the largest integer y (closest to +∞) such that TimeFromYear(y) ≤ tv. 21.4.1.8 DayWithinYear ( tv ) The abstract operation DayWithinYear takes argument tv (a finite time value) and returns an integer in the inclusive interval from 0 to 365. It performs the following steps when called: Return Day(tv) - DayFromYear(YearFromTime(tv)). 21.4.1.9 InLeapYear ( tv ) The abstract operation InLeapYear takes argument tv (a finite time value) and returns 0 or 1. It returns 1 if tv is within a leap year and 0 otherwise. It performs the following steps when called: Let y be YearFromTime(tv). If (y modulo 400) = 0, return 1. If (y modulo 100) = 0, return 0. If (y modulo 4) = 0, return 1. Return 0. 21.4.1.10 MonthFromTime ( tv ) The abstract operation MonthFromTime takes argument tv (a finite time value) and returns an integer in the inclusive interval from 0 to 11. It returns an integer identifying the month in which tv falls. A month value of 0 specifies January; 1 specifies February; 2 specifies March; 3 specifies April; 4 specifies May; 5 specifies June; 6 specifies July; 7 specifies August; 8 specifies September; 9 specifies October; 10 specifies November; and 11 specifies December. Note that MonthFromTime(+0𝔽) = 0, corresponding to Thursday, 1 January 1970. It performs the following steps when called: Let inLeapYear be InLeapYear(tv). Let dayWithinYear be DayWithinYear(tv). If dayWithinYear < 31, return 0. If dayWithinYear < 59 + inLeapYear, return 1. If dayWithinYear < 90 + inLeapYear, return 2. If dayWithinYear < 120 + inLeapYear, return 3. If dayWithinYear < 151 + inLeapYear, return 4. If dayWithinYear < 181 + inLeapYear, return 5. If dayWithinYear < 212 + inLeapYear, return 6. If dayWithinYear < 243 + inLeapYear, return 7. If dayWithinYear < 273 + inLeapYear, return 8. If dayWithinYear < 304 + inLeapYear, return 9. If dayWithinYear < 334 + inLeapYear, return 10. Assert: dayWithinYear < 365 + inLeapYear. Return 11. 21.4.1.11 DateFromTime ( tv ) The abstract operation DateFromTime takes argument tv (a finite time value) and returns an integer in the inclusive interval from 1 to 31. It returns the day of the month in which tv falls. It performs the following steps when called: Let inLeapYear be InLeapYear(tv). Let dayWithinYear be DayWithinYear(tv). Let month be MonthFromTime(tv). If month = 0, return dayWithinYear + 1. If month = 1, return dayWithinYear - 30. If month = 2, return dayWithinYear - 58 - inLeapYear. If month = 3, return dayWithinYear - 89 - inLeapYear. If month = 4, return dayWithinYear - 119 - inLeapYear. If month = 5, return dayWithinYear - 150 - inLeapYear. If month = 6, return dayWithinYear - 180 - inLeapYear. If month = 7, return dayWithinYear - 211 - inLeapYear. If month = 8, return dayWithinYear - 242 - inLeapYear. If month = 9, return dayWithinYear - 272 - inLeapYear. If month = 10, return dayWithinYear - 303 - inLeapYear. Assert: month = 11. Return dayWithinYear - 333 - inLeapYear. 21.4.1.12 WeekDay ( tv ) The abstract operation WeekDay takes argument tv (a finite time value) and returns an integer in the inclusive interval from 0 to 6. It returns an integer identifying the day of the week in which tv falls. A weekday value of 0 specifies Sunday; 1 specifies Monday; 2 specifies Tuesday; 3 specifies Wednesday; 4 specifies Thursday; 5 specifies Friday; and 6 specifies Saturday. Note that WeekDay(+0𝔽) = 4, corresponding to Thursday, 1 January 1970. It performs the following steps when called: Return (Day(tv) + 4) modulo 7. 21.4.1.13 HourFromTime ( tv ) The abstract operation HourFromTime takes argument tv (a finite time value) and returns an integer in the inclusive interval from 0 to 23. It returns the hour of the day in which tv falls. It performs the following steps when called: Return floor(ℝ(tv) / MillisecondsPerHour) modulo HoursPerDay. 21.4.1.14 MinuteFromTime ( tv ) The abstract operation MinuteFromTime takes argument tv (a finite time value) and returns an integer in the inclusive interval from 0 to 59. It returns the minute of the hour in which tv falls. It performs the following steps when called: Return floor(ℝ(tv) / MillisecondsPerMinute) modulo MinutesPerHour. 21.4.1.15 SecondFromTime ( tv ) The abstract operation SecondFromTime takes argument tv (a finite time value) and returns an integer in the inclusive interval from 0 to 59. It returns the second of the minute in which tv falls. It performs the following steps when called: Return floor(ℝ(tv) / MillisecondsPerSecond) modulo SecondsPerMinute. 21.4.1.16 MillisecondFromTime ( tv ) The abstract operation MillisecondFromTime takes argument tv (a finite time value) and returns an integer in the inclusive interval from 0 to 999. It returns the millisecond of the second in which tv falls. It performs the following steps when called: Return ℝ(tv) modulo MillisecondsPerSecond. 21.4.1.17 Epoch Nanoseconds and Range An epoch nanoseconds count is an integer that represents an instant in time to nanosecond precision. It supports the same range as a time value but expressed in nanoseconds, from MinEpochNanoseconds to MaxEpochNanoseconds. There is no nanosecond equivalent of the time value NaN; there is no representation for no specific instant. The exact moment of midnight at the beginning of 1 January 1970 UTC is represented by the value 0. The maximum value is MaxEpochNanoseconds, and the minimum value is MinEpochNanoseconds. 21.4.1.18 GetUTCEpochNanoseconds ( year, month, day, hour, minute, second, millisecond, microsecond, nanosecond ) The abstract operation GetUTCEpochNanoseconds takes arguments year (an integer), month (an integer in the inclusive interval from 1 to 12), day (an integer in the inclusive interval from 1 to 31), hour (an integer in the inclusive interval from 0 to 23), minute (an integer in the inclusive interval from 0 to 59), second (an integer in the inclusive interval from 0 to 59), millisecond (an integer in the inclusive interval from 0 to 999), microsecond (an integer in the inclusive interval from 0 to 999), and nanosecond (an integer in the inclusive interval from 0 to 999) and returns an epoch nanoseconds count. The returned value is the epoch nanoseconds count that corresponds to the given ISO 8601 calendar date and wall-clock time in UTC. It performs the following steps when called: Let date be MakeDay(𝔽(year), 𝔽(month - 1), 𝔽(day)). Let time be MakeTime(𝔽(hour), 𝔽(minute), 𝔽(second), 𝔽(millisecond)). Let epochMilliseconds be MakeDate(date, time). Assert: epochMilliseconds is an integral Number. Return ℝ(epochMilliseconds) × NanosecondsPerMillisecond + microsecond × NanosecondsPerMicrosecond + nanosecond. 21.4.1.19 Time Zone Identifiers Time zones in ECMAScript are represented by time zone identifiers, which are Strings composed entirely of code units in the inclusive interval from 0x0000 to 0x007F. Time zones supported by an ECMAScript implementation may be available named time zones, represented by the [[Identifier]] field of the Time Zone Identifier Records returned by AvailableNamedTimeZoneIdentifiers, or offset time zones, represented by Strings for which IsTimeZoneOffsetString returns true. A primary time zone identifier is the preferred identifier for an available named time zone. A non-primary time zone identifier is an identifier for an available named time zone that is not a primary time zone identifier. An available named time zone identifier is either a primary time zone identifier or a non-primary time zone identifier. Each available named time zone identifier is associated with exactly one available named time zone. Each available named time zone is associated with exactly one primary time zone identifier and zero or more non-primary time zone identifiers. ECMAScript implementations must support an available named time zone with the identifier "UTC", which must be the primary time zone identifier for the UTC time zone. In addition, implementations may support any number of other available named time zones. Implementations that follow the requirements for time zones as described in the ECMA-402 Internationalization API specification are called time zone aware. Time zone aware implementations must support available named time zones corresponding to the “Zone” and “Link” names of the IANA Time Zone Database, and only such names. In time zone aware implementations, a primary time zone identifier is a “Zone” name, and a non-primary time zone identifier is a “Link” name, respectively, in the IANA Time Zone Database except as specifically overridden by AvailableNamedTimeZoneIdentifiers as specified in ECMA-402. Implementations that do not support the entire IANA Time Zone Database are still recommended to use IANA Time Zone Database names as identifiers to represent time zones. 21.4.1.20 GetNamedTimeZoneEpochNanoseconds ( timeZoneIdentifier, year, month, day, hour, minute, second, millisecond, microsecond, nanosecond ) The implementation-defined abstract operation GetNamedTimeZoneEpochNanoseconds takes arguments timeZoneIdentifier (a String), year (an integer), month (an integer in the inclusive interval from 1 to 12), day (an integer in the inclusive interval from 1 to 31), hour (an integer in the inclusive interval from 0 to 23), minute (an integer in the inclusive interval from 0 to 59), second (an integer in the inclusive interval from 0 to 59), millisecond (an integer in the inclusive interval from 0 to 999), microsecond (an integer in the inclusive interval from 0 to 999), and nanosecond (an integer in the inclusive interval from 0 to 999) and returns a List of epoch nanoseconds counts. Each value in the returned List represents an epoch nanoseconds count that corresponds to the given ISO 8601 calendar date and wall-clock time in the named time zone identified by timeZoneIdentifier. When the input represents a local time occurring more than once because of a negative time zone transition (e.g. when daylight saving time ends or the time zone offset is decreased due to a time zone rule change), the returned List will have more than one element and will be sorted by ascending numerical value. When the input represents a local time skipped because of a positive time zone transition (e.g. when daylight saving time begins or the time zone offset is increased due to a time zone rule change), the returned List will be empty. Otherwise, the returned List will have one element. The default implementation of GetNamedTimeZoneEpochNanoseconds, to be used for ECMAScript implementations that do not include local political rules for any time zones, performs the following steps when called: Assert: timeZoneIdentifier is "UTC". Let epochNanoseconds be GetUTCEpochNanoseconds(year, month, day, hour, minute, second, millisecond, microsecond, nanosecond). Return « epochNanoseconds ». Note It is required for time zone aware implementations (and recommended for all others) to use the time zone information of the IANA Time Zone Database. 1:30 AM on 5 November 2017 in America/New_York is repeated twice, so GetNamedTimeZoneEpochNanoseconds("America/New_York", 2017, 11, 5, 1, 30, 0, 0, 0, 0) would return a List of length 2 in which the first element represents 05:30 UTC (corresponding with 01:30 US Eastern Daylight Time at UTC offset -04:00) and the second element represents 06:30 UTC (corresponding with 01:30 US Eastern Standard Time at UTC offset -05:00). 2:30 AM on 12 March 2017 in America/New_York does not exist, so GetNamedTimeZoneEpochNanoseconds("America/New_York", 2017, 3, 12, 2, 30, 0, 0, 0, 0) would return an empty List. 21.4.1.21 GetNamedTimeZoneOffsetNanoseconds ( timeZoneIdentifier, epochNanoseconds ) The implementation-defined abstract operation GetNamedTimeZoneOffsetNanoseconds takes arguments timeZoneIdentifier (a String) and epochNanoseconds (an epoch nanoseconds count) and returns an integer. The returned integer represents the offset from UTC, in nanoseconds, of the named time zone identified by timeZoneIdentifier, at the instant corresponding with the epoch nanoseconds count epochNanoseconds. The default implementation of GetNamedTimeZoneOffsetNanoseconds, to be used for ECMAScript implementations that do not include local political rules for any time zones, performs the following steps when called: Assert: timeZoneIdentifier is "UTC". Return 0. Note Time zone offset values may be positive or negative. 21.4.1.22 Time Zone Identifier Record A Time Zone Identifier Record is a Record used to describe an available named time zone identifier and its corresponding primary time zone identifier. Time Zone Identifier Records have the fields listed in Table 60. Table 60: Time Zone Identifier Record Fields Field Name Value Meaning [[Identifier]] a String An available named time zone identifier that is supported by the implementation. [[PrimaryIdentifier]] a String The primary time zone identifier that [[Identifier]] resolves to. Note If [[Identifier]] is a primary time zone identifier, then [[Identifier]] is [[PrimaryIdentifier]]. 21.4.1.23 AvailableNamedTimeZoneIdentifiers ( ) The implementation-defined abstract operation AvailableNamedTimeZoneIdentifiers takes no arguments and returns a List of Time Zone Identifier Records. Its result describes all available named time zone identifiers in this implementation, as well as the primary time zone identifier corresponding to each available named time zone identifier. The List is ordered according to the [[Identifier]] field of each Time Zone Identifier Record. Time zone aware implementations, including all implementations that implement the ECMA-402 Internationalization API, must implement the AvailableNamedTimeZoneIdentifiers abstract operation as specified in ECMA-402. Otherwise, AvailableNamedTimeZoneIdentifiers performs the following steps when called: If the implementation does not include local political rules for any time zones, then Return « the Time Zone Identifier Record { [[Identifier]]: "UTC", [[PrimaryIdentifier]]: "UTC" } ». Let identifiers be the List of unique available named time zone identifiers, sorted according to lexicographic code unit order. Let result be a new empty List. For each element identifier of identifiers, do Let primary be identifier. If identifier is a non-primary time zone identifier in this implementation and identifier is not "UTC", then Set primary to the primary time zone identifier associated with identifier. NOTE: An implementation may need to resolve identifier iteratively to obtain the primary time zone identifier. Let record be the Time Zone Identifier Record { [[Identifier]]: identifier, [[PrimaryIdentifier]]: primary }. Append record to result. Assert: result contains a Time Zone Identifier Record record such that record.[[Identifier]] is "UTC" and record.[[PrimaryIdentifier]] is "UTC". Return result. 21.4.1.24 SystemTimeZoneIdentifier ( ) The implementation-defined abstract operation SystemTimeZoneIdentifier takes no arguments and returns a String. It returns a String representing the host environment's current time zone, which is either a String representing a UTC offset for which IsTimeZoneOffsetString returns true, or a primary time zone identifier. It performs the following steps when called: If the implementation only supports the UTC time zone, return "UTC". Let systemTimeZoneString be the String representing the host environment's current time zone, either a primary time zone identifier or an offset time zone identifier. Return systemTimeZoneString. Note To ensure the level of functionality that implementations commonly provide in the methods of the Date object, it is recommended that SystemTimeZoneIdentifier return an IANA time zone name corresponding to the host environment's time zone setting, if such a thing exists. GetNamedTimeZoneEpochNanoseconds and GetNamedTimeZoneOffsetNanoseconds must reflect the local political rules for standard time and daylight saving time in that time zone, if such rules exist. For example, if the host environment is a browser on a system where the user has chosen US Eastern Time as their time zone, SystemTimeZoneIdentifier returns "America/New_York". 21.4.1.25 LocalTime ( tv ) The abstract operation LocalTime takes argument tv (a finite time value) and returns an integral Number. It converts tv from UTC to local time. The local political rules for standard time and daylight saving time in effect at tv should be used to determine the result in the way specified in this section. It performs the following steps when called: Let systemTimeZoneIdentifier be SystemTimeZoneIdentifier(). If IsTimeZoneOffsetString(systemTimeZoneIdentifier) is true, then Let offsetNanoseconds be ParseTimeZoneOffsetString(systemTimeZoneIdentifier). Else, Let offsetNanoseconds be GetNamedTimeZoneOffsetNanoseconds(systemTimeZoneIdentifier, ℝ(tv) × NanosecondsPerMillisecond). Let offsetMilliseconds be truncate(offsetNanoseconds / NanosecondsPerMillisecond). Return tv + 𝔽(offsetMilliseconds). Note 1 If political rules for the local time tv are not available within the implementation, the result is tv because SystemTimeZoneIdentifier returns "UTC" and GetNamedTimeZoneOffsetNanoseconds returns 0. Note 2 It is required for time zone aware implementations (and recommended for all others) to use the time zone information of the IANA Time Zone Database https://www.iana.org/time-zones/. Note 3 Two different input time values tvUTC are converted to the same local time tlocal at a negative time zone transition when there are repeated times (e.g. the daylight saving time ends or the time zone adjustment is decreased.). LocalTime(UTC(tvlocal)) is not necessarily always equal to tvlocal. Correspondingly, UTC(LocalTime(tvUTC)) is not necessarily always equal to tvUTC. 21.4.1.26 UTC ( t ) The abstract operation UTC takes argument t (a Number) and returns a time value. It converts t from local time to a UTC time value. The local political rules for standard time and daylight saving time in effect at t should be used to determine the result in the way specified in this section. It performs the following steps when called: If t is not a finite Number, return NaN. Let systemTimeZoneIdentifier be SystemTimeZoneIdentifier(). If IsTimeZoneOffsetString(systemTimeZoneIdentifier) is true, then Let offsetNanoseconds be ParseTimeZoneOffsetString(systemTimeZoneIdentifier). Else, Let possibleInstants be GetNamedTimeZoneEpochNanoseconds(systemTimeZoneIdentifier, YearFromTime(t), MonthFromTime(t) + 1, DateFromTime(t), HourFromTime(t), MinuteFromTime(t), SecondFromTime(t), MillisecondFromTime(t), 0, 0). NOTE: The following steps ensure that when t represents local time repeating multiple times at a negative time zone transition (e.g. when the daylight saving time ends or the time zone offset is decreased due to a time zone rule change) or skipped local time at a positive time zone transition (e.g. when the daylight saving time starts or the time zone offset is increased due to a time zone rule change), t is interpreted using the time zone offset before the transition. If possibleInstants is not empty, then Let disambiguatedInstant be possibleInstants[0]. Else, NOTE: t represents a local time skipped at a positive time zone transition (e.g. due to daylight saving time starting or a time zone rule change increasing the UTC offset). Let possibleInstantsBefore be GetNamedTimeZoneEpochNanoseconds(systemTimeZoneIdentifier, YearFromTime(tBefore), MonthFromTime(tBefore) + 1, DateFromTime(tBefore), HourFromTime(tBefore), MinuteFromTime(tBefore), SecondFromTime(tBefore), MillisecondFromTime(tBefore), 0, 0), where tBefore is the largest integral Number < t for which possibleInstantsBefore is not empty (i.e., tBefore represents the last local time before the transition). Let disambiguatedInstant be the last element of possibleInstantsBefore. Let offsetNanoseconds be GetNamedTimeZoneOffsetNanoseconds(systemTimeZoneIdentifier, disambiguatedInstant). Let offsetMilliseconds be truncate(offsetNanoseconds / NanosecondsPerMillisecond). Return t - 𝔽(offsetMilliseconds). Input t is nominally a time value but may be any Number value. The algorithm must not limit t to the time value range, so that inputs corresponding with a boundary of the time value range can be supported regardless of local UTC offset. For example, the maximum time value is 8.64 × 1015, corresponding with "+275760-09-13T00:00:00Z". In an environment where the local time zone offset is ahead of UTC by 1 hour at that instant, it is represented by the larger input of 8.64 × 1015 + 3.6 × 106, corresponding with "+275760-09-13T01:00:00+01:00". If political rules for the local time t are not available within the implementation, the result is t because SystemTimeZoneIdentifier returns "UTC" and GetNamedTimeZoneOffsetNanoseconds returns 0. Note 1 It is required for time zone aware implementations (and recommended for all others) to use the time zone information of the IANA Time Zone Database. 1:30 AM on 5 November 2017 in America/New_York is repeated twice (fall backward), but it must be interpreted as 1:30 AM UTC-04 instead of 1:30 AM UTC-05. In UTC(TimeClip(MakeDate(MakeDay(2017, 10, 5), MakeTime(1, 30, 0, 0)))), the value of offsetMilliseconds is -4 × MillisecondsPerHour. 2:30 AM on 12 March 2017 in America/New_York does not exist, but it must be interpreted as 2:30 AM UTC-05 (equivalent to 3:30 AM UTC-04). In UTC(TimeClip(MakeDate(MakeDay(2017, 2, 12), MakeTime(2, 30, 0, 0)))), the value of offsetMilliseconds is -5 × MillisecondsPerHour. Note 2 UTC(LocalTime(tUTC)) is not necessarily always equal to tUTC. Correspondingly, LocalTime(UTC(tlocal)) is not necessarily always equal to tlocal. 21.4.1.27 MakeTime ( hour, minute, second, millisecond ) The abstract operation MakeTime takes arguments hour (a Number), minute (a Number), second (a Number), and millisecond (a Number) and returns a Number. It calculates a number of milliseconds. It performs the following steps when called: If hour is not a finite Number, minute is not a finite Number, second is not a finite Number, or millisecond is not a finite Number, return NaN. Let hourMV be ! ToIntegerOrInfinity(hour). Let minuteMV be ! ToIntegerOrInfinity(minute). Let secondMV be ! ToIntegerOrInfinity(second). Let millisecondMV be ! ToIntegerOrInfinity(millisecond). Return ((𝔽(hourMV) × 𝔽(MillisecondsPerHour) + 𝔽(minuteMV) × 𝔽(MillisecondsPerMinute)) + 𝔽(secondMV) × 𝔽(MillisecondsPerSecond)) + 𝔽(millisecondMV). Note The arithmetic in MakeTime is floating-point arithmetic, which is not associative, so the operations must be performed in the correct order. 21.4.1.28 MakeDay ( year, month, day ) The abstract operation MakeDay takes arguments year (a Number), month (a Number), and day (a Number) and returns a finite Number or NaN. It calculates a number of days. It performs the following steps when called: If year is not a finite Number, month is not a finite Number, or day is not a finite Number, return NaN. Let yearMV be ! ToIntegerOrInfinity(year). Let monthMV be ! ToIntegerOrInfinity(month). Let dayMV be ! ToIntegerOrInfinity(day). Let balancedYear be 𝔽(yearMV) + 𝔽(floor(monthMV / 12)). If balancedYear is not a finite Number, return NaN. Let balancedMonthMV be monthMV modulo 12. Find a finite time value tv such that YearFromTime(tv) = ℝ(balancedYear), MonthFromTime(tv) = balancedMonthMV, and DateFromTime(tv) = 1; but if this is not possible (because some argument is out of range), return NaN. Return 𝔽(Day(tv)) + 𝔽(dayMV) - 1𝔽. 21.4.1.29 MakeDate ( day, time ) The abstract operation MakeDate takes arguments day (a Number) and time (a Number) and returns a finite Number or NaN. It calculates a number of milliseconds. It performs the following steps when called: If day is not a finite Number or time is not a finite Number, return NaN. Let tv be day × 𝔽(MillisecondsPerDay) + time. If tv is not a finite Number, return NaN. Return tv. 21.4.1.30 MakeFullYear ( year ) The abstract operation MakeFullYear takes argument year (a Number) and returns an integral Number or NaN. It returns the full year associated with the integer part of year, interpreting any value in the inclusive interval from 0 to 99 as a count of years since the start of 1900. For alignment with the proleptic Gregorian calendar, “full year” is defined as the signed count of complete years since the start of year 0 (1 B.C.). It performs the following steps when called: If year is one of NaN, +∞𝔽, or -∞𝔽, return NaN. Let truncated be ! ToIntegerOrInfinity(year). If truncated is in the inclusive interval from 0 to 99, return 1900𝔽 + 𝔽(truncated). Return 𝔽(truncated). 21.4.1.31 TimeClip ( time ) The abstract operation TimeClip takes argument time (a Number) and returns a time value. It calculates a number of milliseconds. It performs the following steps when called: If time is not a finite Number, return NaN. If abs(ℝ(time)) > 8.64 × 1015, return NaN. Return 𝔽(! ToIntegerOrInfinity(time)). 21.4.1.32 Date Time String Format ECMAScript defines a string interchange format for date-times which is adapted from the ISO 8601 calendar date extended format. The format is as follows: YYYY-MM-DDTHH:mm:ss.sssZ Where the elements are as follows: YYYY is the year in the proleptic Gregorian calendar as four decimal digits from 0000 to 9999, or as an expanded year of "+" or "-" followed by six decimal digits. - "-" (hyphen) appears literally twice in the string. MM is the month of the year as two decimal digits from 01 (January) to 12 (December). DD is the day of the month as two decimal digits from 01 to 31. T "T" appears literally in the string, to indicate the beginning of the time element. HH is the number of complete hours that have passed since midnight as two decimal digits from 00 to 24. : ":" (colon) appears literally twice in the string. mm is the number of complete minutes since the start of the hour as two decimal digits from 00 to 59. ss is the number of complete seconds since the start of the minute as two decimal digits from 00 to 59. . "." (dot) appears literally in the string. sss is the number of complete milliseconds since the start of the second as three decimal digits. Z is the UTC offset representation specified as "Z" (for UTC with no offset) or as either "+" or "-" followed by a time expression HH:mm (a subset of the time zone offset string format for indicating local time ahead of or behind UTC, respectively) This format includes date-only forms: YYYY YYYY-MM YYYY-MM-DD It also includes “date-time” forms that consist of one of the above date-only forms immediately followed by one of the following time forms with an optional UTC offset representation appended: THH:mm THH:mm:ss THH:mm:ss.sss A string containing out-of-bounds or nonconforming elements is not a valid instance of this format. Note 1 As every day both starts and ends with midnight, the two notations 00:00 and 24:00 are available to distinguish the two midnights that can be associated with one date. This means that the following two notations refer to exactly the same point in time: 1995-02-04T24:00 and 1995-02-05T00:00. Note 2 This format does not support annotations with a time zone name as defined in RFC 9557, only a numeric representation of the time zone offset. 21.4.1.32.1 Expanded Years Covering the full time value range of approximately 273,790 years forward or backward from 1 January 1970 (21.4.1.1) requires representing years before 0 or after 9999. ISO 8601 permits expansion of the year representation, but only by mutual agreement of the partners in information interchange. In the simplified ECMAScript format, such an expanded year representation shall have 6 digits and is always prefixed with a + or - sign. The year 0 is considered positive and must be prefixed with a + sign. The representation of the year 0 as -000000 is invalid. Strings matching the Date Time String Format with expanded years representing instants in time outside the range of a time value are treated as unrecognizable by Date.parse and cause that function to return NaN without falling back to implementation-specific behaviour or heuristics. Note Examples of date-time values with expanded years: -271821-04-20T00:00:00Z 271822 B.C. -000001-01-01T00:00:00Z 2 B.C. +000000-01-01T00:00:00Z 1 B.C. +000001-01-01T00:00:00Z 1 A.D. +001970-01-01T00:00:00Z 1970 A.D. +002009-12-15T00:00:00Z 2009 A.D. +275760-09-13T00:00:00Z 275760 A.D. 21.4.1.33 Time Zone Offset String Format ECMAScript defines a string interchange format for UTC offsets, derived from ISO 8601. The format is described by the following grammar. Syntax UTCOffset ::: ASCIISign Hour ASCIISign Hour HourSubcomponents[+Extended] ASCIISign Hour HourSubcomponents[~Extended] ASCIISign ::: one of + - Hour ::: 0 DecimalDigit 1 DecimalDigit 20 21 22 23 HourSubcomponents[Extended] ::: TimeSeparator[?Extended] MinuteSecond TimeSeparator[?Extended] MinuteSecond TimeSeparator[?Extended] MinuteSecond TemporalDecimalFractionopt TimeSeparator[Extended] ::: [+Extended] : [~Extended] [empty] MinuteSecond ::: 0 DecimalDigit 1 DecimalDigit 2 DecimalDigit 3 DecimalDigit 4 DecimalDigit 5 DecimalDigit TemporalDecimalFraction ::: TemporalDecimalSeparator DecimalDigit TemporalDecimalSeparator DecimalDigit DecimalDigit TemporalDecimalSeparator DecimalDigit DecimalDigit DecimalDigit TemporalDecimalSeparator DecimalDigit DecimalDigit DecimalDigit DecimalDigit TemporalDecimalSeparator DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit TemporalDecimalSeparator DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit TemporalDecimalSeparator DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit TemporalDecimalSeparator DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit TemporalDecimalSeparator DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit TemporalDecimalSeparator ::: one of . , 21.4.1.33.1 IsTimeZoneOffsetString ( offsetString ) The abstract operation IsTimeZoneOffsetString takes argument offsetString (a String) and returns a Boolean. The return value indicates whether offsetString conforms to the grammar given by UTCOffset. It performs the following steps when called: Let parseResult be ParseText(offsetString, UTCOffset). If parseResult is a List of errors, return false. Return true. 21.4.1.33.2 ParseTimeZoneOffsetString ( offsetString ) The abstract operation ParseTimeZoneOffsetString takes argument offsetString (a String) and returns an integer. The return value is the UTC offset, as a number of nanoseconds, that corresponds to the String offsetString. It performs the following steps when called: Let parseResult be ParseText(offsetString, UTCOffset). Assert: parseResult is not a List of errors. Assert: parseResult contains a ASCIISign Parse Node. Let parsedSign be the source text matched by the ASCIISign Parse Node contained within parseResult. If parsedSign is the single code point U+002D (HYPHEN-MINUS), then Let sign be -1. Else, Let sign be 1. NOTE: Applications of StringToNumber below do not lose precision, since each of the parsed values is guaranteed to be a sufficiently short string of decimal digits. Assert: parseResult contains an Hour Parse Node. Let parsedHours be the source text matched by the Hour Parse Node contained within parseResult. Let hours be ℝ(StringToNumber(CodePointsToString(parsedHours))). If parseResult does not contain a MinuteSecond Parse Node, then Let minutes be 0. Else, Let parsedMinutes be the source text matched by the first MinuteSecond Parse Node contained within parseResult. Let minutes be ℝ(StringToNumber(CodePointsToString(parsedMinutes))). If parseResult does not contain two MinuteSecond Parse Nodes, then Let seconds be 0. Else, Let parsedSeconds be the source text matched by the second MinuteSecond Parse Node contained within parseResult. Let seconds be ℝ(StringToNumber(CodePointsToString(parsedSeconds))). If parseResult does not contain a TemporalDecimalFraction Parse Node, then Let nanoseconds be 0. Else, Let parsedFraction be the source text matched by the TemporalDecimalFraction Parse Node contained within parseResult. Let fraction be the string-concatenation of CodePointsToString(parsedFraction) and "000000000". Let nanosecondsString be the substring of fraction from 1 to 10. Let nanoseconds be ℝ(StringToNumber(nanosecondsString)). Return sign × (((hours × MinutesPerHour + minutes) × SecondsPerMinute + seconds) × NanosecondsPerSecond + nanoseconds). 21.4.2 The Date Constructor The Date constructor: is %Date%. is the initial value of the "Date" property of the global object. creates and initializes a new Date when called as a constructor. returns a String representing the current time (UTC) when called as a function rather than as a constructor. is a function whose behaviour differs based upon the number and types of its arguments. may be used as the value of an extends clause of a class definition. Subclass constructors that intend to inherit the specified Date behaviour must include a super call to the Date constructor to create and initialize the subclass instance with a [[DateValue]] internal slot. 21.4.2.1 Date ( ...values ) This function performs the following steps when called: If NewTarget is undefined, then Let now be the time value (UTC) identifying the current time. Return ToDateString(now). Let numberOfArgs be the number of elements in values. If numberOfArgs = 0, then Let dv be the time value (UTC) identifying the current time. Else if numberOfArgs = 1, then Let value be values[0]. If value is an Object and value has a [[DateValue]] internal slot, then Let tv be value.[[DateValue]]. Else, Let primitive be ? ToPrimitive(value). If primitive is a String, then Assert: The next step never returns an abrupt completion because primitive is a String. Let tv be the result of parsing primitive as a date, in exactly the same manner as for the parse method (21.4.3.2). Else, Let tv be ? ToNumber(primitive). Let dv be TimeClip(tv). Else, Assert: numberOfArgs ≥ 2. Let yearNumber be ? ToNumber(values[0]). Let monthNumber be ? ToNumber(values[1]). If numberOfArgs > 2, let dayNumber be ? ToNumber(values[2]); else let dayNumber be 1𝔽. If numberOfArgs > 3, let hourNumber be ? ToNumber(values[3]); else let hourNumber be +0𝔽. If numberOfArgs > 4, let minuteNumber be ? ToNumber(values[4]); else let minuteNumber be +0𝔽. If numberOfArgs > 5, let secondNumber be ? ToNumber(values[5]); else let secondNumber be +0𝔽. If numberOfArgs > 6, let millisecondNumber be ? ToNumber(values[6]); else let millisecondNumber be +0𝔽. Set yearNumber to MakeFullYear(yearNumber). Let finalDate be MakeDate(MakeDay(yearNumber, monthNumber, dayNumber), MakeTime(hourNumber, minuteNumber, secondNumber, millisecondNumber)). Let dv be TimeClip(UTC(finalDate)). Let obj be ? OrdinaryCreateFromConstructor(NewTarget, "%Date.prototype%", « [[DateValue]] »). Set obj.[[DateValue]] to dv. Return obj. 21.4.3 Properties of the Date Constructor The Date constructor: has a [[Prototype]] internal slot whose value is %Function.prototype%. has a "length" property whose value is 7𝔽. has the following properties: 21.4.3.1 Date.now ( ) This function returns the time value designating the UTC date and time of the occurrence of the call to it. 21.4.3.2 Date.parse ( string ) This function applies the ToString operator to its argument. If ToString results in an abrupt completion the Completion Record is immediately returned. Otherwise, this function interprets the resulting String as a date and time; it returns a Number, the UTC time value corresponding to the date and time. The String may be interpreted as a local time, a UTC time, or a time in some other time zone, depending on the contents of the String. The function first attempts to parse the String according to the format described in Date Time String Format (21.4.1.32), including expanded years. If the String does not conform to that format the function may fall back to any implementation-specific heuristics or implementation-specific date formats. Strings that are unrecognizable or contain out-of-bounds format element values shall cause this function to return NaN. If the String conforms to the Date Time String Format, substitute values take the place of absent format elements. When the MM or DD elements are absent, "01" is used. When the HH, mm, or ss elements are absent, "00" is used. When the sss element is absent, "000" is used. When the UTC offset representation is absent, date-only forms are interpreted as a UTC time and date-time forms are interpreted as a local time. If x is any Date whose milliseconds amount is zero within a particular implementation of ECMAScript, then all of the following expressions should produce the same numeric value in that implementation, if all the properties referenced have their initial values: x.valueOf() Date.parse(x.toString()) Date.parse(x.toUTCString()) Date.parse(x.toISOString()) However, the expression Date.parse(x.toLocaleString()) is not required to produce the same Number value as the preceding three expressions and, in general, the value produced by this function is implementation-defined when given any String value that does not conform to the Date Time String Format (21.4.1.32) and that could not be produced in that implementation by the toString or toUTCString method. 21.4.3.3 Date.prototype The initial value of Date.prototype is the Date prototype object. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. 21.4.3.4 Date.UTC ( year [ , month [ , day [ , hour [ , minute [ , second [ , millisecond ] ] ] ] ] ] ) This function performs the following steps when called: Let yearNumber be ? ToNumber(year). If month is present, let monthNumber be ? ToNumber(month); else let monthNumber be +0𝔽. If day is present, let dayNumber be ? ToNumber(day); else let dayNumber be 1𝔽. If hour is present, let hourNumber be ? ToNumber(hour); else let hourNumber be +0𝔽. If minute is present, let minuteNumber be ? ToNumber(minute); else let minuteNumber be +0𝔽. If second is present, let secondNumber be ? ToNumber(second); else let secondNumber be +0𝔽. If millisecond is present, let millisecondNumber be ? ToNumber(millisecond); else let millisecondNumber be +0𝔽. Set yearNumber to MakeFullYear(yearNumber). Return TimeClip(MakeDate(MakeDay(yearNumber, monthNumber, dayNumber), MakeTime(hourNumber, minuteNumber, secondNumber, millisecondNumber))). The "length" property of this function is 7𝔽. Note This function differs from the Date constructor in two ways: it returns a time value as a Number, rather than creating a Date, and it interprets the arguments in UTC rather than as local time. 21.4.4 Properties of the Date Prototype Object The Date prototype object: is %Date.prototype%. is itself an ordinary object. is not a Date instance and does not have a [[DateValue]] internal slot. has a [[Prototype]] internal slot whose value is %Object.prototype%. Unless explicitly defined otherwise, the methods of the Date prototype object defined below are not generic and the this value passed to them must be an object that has a [[DateValue]] internal slot that has been initialized to a time value. 21.4.4.1 Date.prototype.constructor The initial value of Date.prototype.constructor is %Date%. 21.4.4.2 Date.prototype.getDate ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(DateFromTime(LocalTime(tv))). 21.4.4.3 Date.prototype.getDay ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(WeekDay(LocalTime(tv))). 21.4.4.4 Date.prototype.getFullYear ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(YearFromTime(LocalTime(tv))). 21.4.4.5 Date.prototype.getHours ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(HourFromTime(LocalTime(tv))). 21.4.4.6 Date.prototype.getMilliseconds ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(MillisecondFromTime(LocalTime(tv))). 21.4.4.7 Date.prototype.getMinutes ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(MinuteFromTime(LocalTime(tv))). 21.4.4.8 Date.prototype.getMonth ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(MonthFromTime(LocalTime(tv))). 21.4.4.9 Date.prototype.getSeconds ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(SecondFromTime(LocalTime(tv))). 21.4.4.10 Date.prototype.getTime ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Return dateObj.[[DateValue]]. 21.4.4.11 Date.prototype.getTimezoneOffset ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return (tv - LocalTime(tv)) / 𝔽(MillisecondsPerMinute). 21.4.4.12 Date.prototype.getUTCDate ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(DateFromTime(tv)). 21.4.4.13 Date.prototype.getUTCDay ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(WeekDay(tv)). 21.4.4.14 Date.prototype.getUTCFullYear ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(YearFromTime(tv)). 21.4.4.15 Date.prototype.getUTCHours ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(HourFromTime(tv)). 21.4.4.16 Date.prototype.getUTCMilliseconds ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(MillisecondFromTime(tv)). 21.4.4.17 Date.prototype.getUTCMinutes ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(MinuteFromTime(tv)). 21.4.4.18 Date.prototype.getUTCMonth ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(MonthFromTime(tv)). 21.4.4.19 Date.prototype.getUTCSeconds ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return NaN. Return 𝔽(SecondFromTime(tv)). 21.4.4.20 Date.prototype.setDate ( day ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. Let dayNumber be ? ToNumber(day). If tv is NaN, return NaN. Set tv to LocalTime(tv). Let newDate be MakeDate(MakeDay(𝔽(YearFromTime(tv)), 𝔽(MonthFromTime(tv)), dayNumber), 𝔽(TimeWithinDay(tv))). Let u be TimeClip(UTC(newDate)). Set dateObj.[[DateValue]] to u. Return u. 21.4.4.21 Date.prototype.setFullYear ( year [ , month [ , day ] ] ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. Let yearNumber be ? ToNumber(year). If tv is NaN, set tv to +0𝔽; else set tv to LocalTime(tv). If month is present, let monthNumber be ? ToNumber(month); else let monthNumber be 𝔽(MonthFromTime(tv)). If day is present, let dayNumber be ? ToNumber(day); else let dayNumber be 𝔽(DateFromTime(tv)). Let newDate be MakeDate(MakeDay(yearNumber, monthNumber, dayNumber), 𝔽(TimeWithinDay(tv))). Let u be TimeClip(UTC(newDate)). Set dateObj.[[DateValue]] to u. Return u. The "length" property of this method is 3𝔽. Note If month is not present, this method behaves as if month was present with the value getMonth(). If day is not present, it behaves as if day was present with the value getDate(). 21.4.4.22 Date.prototype.setHours ( hour [ , minute [ , second [ , millisecond ] ] ] ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. Let hourNumber be ? ToNumber(hour). If minute is present, let minuteNumber be ? ToNumber(minute). If second is present, let secondNumber be ? ToNumber(second). If millisecond is present, let millisecondNumber be ? ToNumber(millisecond). If tv is NaN, return NaN. Set tv to LocalTime(tv). If minute is not present, let minuteNumber be 𝔽(MinuteFromTime(tv)). If second is not present, let secondNumber be 𝔽(SecondFromTime(tv)). If millisecond is not present, let millisecondNumber be 𝔽(MillisecondFromTime(tv)). Let date be MakeDate(𝔽(Day(tv)), MakeTime(hourNumber, minuteNumber, secondNumber, millisecondNumber)). Let u be TimeClip(UTC(date)). Set dateObj.[[DateValue]] to u. Return u. The "length" property of this method is 4𝔽. Note If minute is not present, this method behaves as if minute was present with the value getMinutes(). If second is not present, it behaves as if second was present with the value getSeconds(). If millisecond is not present, it behaves as if millisecond was present with the value getMilliseconds(). 21.4.4.23 Date.prototype.setMilliseconds ( millisecond ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. Let millisecondNumber be ? ToNumber(millisecond). If tv is NaN, return NaN. Set tv to LocalTime(tv). Let time be MakeTime(𝔽(HourFromTime(tv)), 𝔽(MinuteFromTime(tv)), 𝔽(SecondFromTime(tv)), millisecondNumber). Let u be TimeClip(UTC(MakeDate(𝔽(Day(tv)), time))). Set dateObj.[[DateValue]] to u. Return u. 21.4.4.24 Date.prototype.setMinutes ( minute [ , second [ , millisecond ] ] ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. Let minuteNumber be ? ToNumber(minute). If second is present, let secondNumber be ? ToNumber(second). If millisecond is present, let millisecondNumber be ? ToNumber(millisecond). If tv is NaN, return NaN. Set tv to LocalTime(tv). If second is not present, let secondNumber be 𝔽(SecondFromTime(tv)). If millisecond is not present, let millisecondNumber be 𝔽(MillisecondFromTime(tv)). Let date be MakeDate(𝔽(Day(tv)), MakeTime(𝔽(HourFromTime(tv)), minuteNumber, secondNumber, millisecondNumber)). Let u be TimeClip(UTC(date)). Set dateObj.[[DateValue]] to u. Return u. The "length" property of this method is 3𝔽. Note If second is not present, this method behaves as if second was present with the value getSeconds(). If millisecond is not present, this behaves as if millisecond was present with the value getMilliseconds(). 21.4.4.25 Date.prototype.setMonth ( month [ , day ] ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. Let monthNumber be ? ToNumber(month). If day is present, let dayNumber be ? ToNumber(day). If tv is NaN, return NaN. Set tv to LocalTime(tv). If day is not present, let dayNumber be 𝔽(DateFromTime(tv)). Let newDate be MakeDate(MakeDay(𝔽(YearFromTime(tv)), monthNumber, dayNumber), 𝔽(TimeWithinDay(tv))). Let u be TimeClip(UTC(newDate)). Set dateObj.[[DateValue]] to u. Return u. The "length" property of this method is 2𝔽. Note If day is not present, this method behaves as if day was present with the value getDate(). 21.4.4.26 Date.prototype.setSeconds ( second [ , millisecond ] ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. Let secondNumber be ? ToNumber(second). If millisecond is present, let millisecondNumber be ? ToNumber(millisecond). If tv is NaN, return NaN. Set tv to LocalTime(tv). If millisecond is not present, let millisecondNumber be 𝔽(MillisecondFromTime(tv)). Let date be MakeDate(𝔽(Day(tv)), MakeTime(𝔽(HourFromTime(tv)), 𝔽(MinuteFromTime(tv)), secondNumber, millisecondNumber)). Let u be TimeClip(UTC(date)). Set dateObj.[[DateValue]] to u. Return u. The "length" property of this method is 2𝔽. Note If millisecond is not present, this method behaves as if millisecond was present with the value getMilliseconds(). 21.4.4.27 Date.prototype.setTime ( time ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let t be ? ToNumber(time). Let v be TimeClip(t). Set dateObj.[[DateValue]] to v. Return v. 21.4.4.28 Date.prototype.setUTCDate ( day ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. Let dayNumber be ? ToNumber(day). If tv is NaN, return NaN. Let newDate be MakeDate(MakeDay(𝔽(YearFromTime(tv)), 𝔽(MonthFromTime(tv)), dayNumber), 𝔽(TimeWithinDay(tv))). Let v be TimeClip(newDate). Set dateObj.[[DateValue]] to v. Return v. 21.4.4.29 Date.prototype.setUTCFullYear ( year [ , month [ , day ] ] ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, set tv to +0𝔽. Let yearNumber be ? ToNumber(year). If month is present, let monthNumber be ? ToNumber(month); else let monthNumber be 𝔽(MonthFromTime(tv)). If day is present, let dayNumber be ? ToNumber(day); else let dayNumber be 𝔽(DateFromTime(tv)). Let newDate be MakeDate(MakeDay(yearNumber, monthNumber, dayNumber), 𝔽(TimeWithinDay(tv))). Let v be TimeClip(newDate). Set dateObj.[[DateValue]] to v. Return v. The "length" property of this method is 3𝔽. Note If month is not present, this method behaves as if month was present with the value getUTCMonth(). If day is not present, it behaves as if day was present with the value getUTCDate(). 21.4.4.30 Date.prototype.setUTCHours ( hour [ , minute [ , second [ , millisecond ] ] ] ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. Let hourNumber be ? ToNumber(hour). If minute is present, let minuteNumber be ? ToNumber(minute). If second is present, let secondNumber be ? ToNumber(second). If millisecond is present, let millisecondNumber be ? ToNumber(millisecond). If tv is NaN, return NaN. If minute is not present, let minuteNumber be 𝔽(MinuteFromTime(tv)). If second is not present, let secondNumber be 𝔽(SecondFromTime(tv)). If millisecond is not present, let millisecondNumber be 𝔽(MillisecondFromTime(tv)). Let date be MakeDate(𝔽(Day(tv)), MakeTime(hourNumber, minuteNumber, secondNumber, millisecondNumber)). Let v be TimeClip(date). Set dateObj.[[DateValue]] to v. Return v. The "length" property of this method is 4𝔽. Note If minute is not present, this method behaves as if minute was present with the value getUTCMinutes(). If second is not present, it behaves as if second was present with the value getUTCSeconds(). If millisecond is not present, it behaves as if millisecond was present with the value getUTCMilliseconds(). 21.4.4.31 Date.prototype.setUTCMilliseconds ( millisecond ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. Let millisecondNumber be ? ToNumber(millisecond). If tv is NaN, return NaN. Let time be MakeTime(𝔽(HourFromTime(tv)), 𝔽(MinuteFromTime(tv)), 𝔽(SecondFromTime(tv)), millisecondNumber). Let v be TimeClip(MakeDate(𝔽(Day(tv)), time)). Set dateObj.[[DateValue]] to v. Return v. 21.4.4.32 Date.prototype.setUTCMinutes ( minute [ , second [ , millisecond ] ] ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. Let minuteNumber be ? ToNumber(minute). If second is present, let secondNumber be ? ToNumber(second). If millisecond is present, let millisecondNumber be ? ToNumber(millisecond). If tv is NaN, return NaN. If second is not present, let secondNumber be 𝔽(SecondFromTime(tv)). If millisecond is not present, let millisecondNumber be 𝔽(MillisecondFromTime(tv)). Let date be MakeDate(𝔽(Day(tv)), MakeTime(𝔽(HourFromTime(tv)), minuteNumber, secondNumber, millisecondNumber)). Let v be TimeClip(date). Set dateObj.[[DateValue]] to v. Return v. The "length" property of this method is 3𝔽. Note If second is not present, this method behaves as if second was present with the value getUTCSeconds(). If millisecond is not present, it behaves as if millisecond was present with the value return by getUTCMilliseconds(). 21.4.4.33 Date.prototype.setUTCMonth ( month [ , day ] ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. Let monthNumber be ? ToNumber(month). If day is present, let dayNumber be ? ToNumber(day). If tv is NaN, return NaN. If day is not present, let dayNumber be 𝔽(DateFromTime(tv)). Let newDate be MakeDate(MakeDay(𝔽(YearFromTime(tv)), monthNumber, dayNumber), 𝔽(TimeWithinDay(tv))). Let v be TimeClip(newDate). Set dateObj.[[DateValue]] to v. Return v. The "length" property of this method is 2𝔽. Note If day is not present, this method behaves as if day was present with the value getUTCDate(). 21.4.4.34 Date.prototype.setUTCSeconds ( second [ , millisecond ] ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. Let secondNumber be ? ToNumber(second). If millisecond is present, let millisecondNumber be ? ToNumber(millisecond). If tv is NaN, return NaN. If millisecond is not present, let millisecondNumber be 𝔽(MillisecondFromTime(tv)). Let date be MakeDate(𝔽(Day(tv)), MakeTime(𝔽(HourFromTime(tv)), 𝔽(MinuteFromTime(tv)), secondNumber, millisecondNumber)). Let v be TimeClip(date). Set dateObj.[[DateValue]] to v. Return v. The "length" property of this method is 2𝔽. Note If millisecond is not present, this method behaves as if millisecond was present with the value getUTCMilliseconds(). 21.4.4.35 Date.prototype.toDateString ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return "Invalid Date". Let t be LocalTime(tv). Return DateString(t). 21.4.4.36 Date.prototype.toISOString ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, throw a RangeError exception. Assert: tv is an integral Number. If tv corresponds with a year that cannot be represented in the Date Time String Format, throw a RangeError exception. Return a String representation of tv in the Date Time String Format on the UTC time scale, including all format elements and the UTC offset representation "Z". 21.4.4.37 Date.prototype.toJSON ( key ) This method provides a String representation of a Date for use by JSON.stringify (25.5.4). It performs the following steps when called: Let obj be ? ToObject(this value). Let tv be ? ToPrimitive(obj, number). If tv is a Number and tv is not a finite Number, return null. Return ? Invoke(obj, "toISOString"). Note 1 The argument is ignored. Note 2 This method is intentionally generic; it does not require that its this value be a Date. Therefore, it can be transferred to other kinds of objects for use as a method. However, it does require that any such object have a toISOString method. 21.4.4.38 Date.prototype.toLocaleDateString ( [ reserved1 [ , reserved2 ] ] ) An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in ECMA-402. Otherwise, the following specification of this method is used: This method returns a String value. The contents of the String are implementation-defined, but are intended to represent the “date” portion of the Date in the current time zone in a convenient, human-readable form that corresponds to the conventions of the host environment's current locale. The meaning of the optional parameters to this method are defined in ECMA-402; implementations that do not include ECMA-402 support must not use those parameter positions for anything else. 21.4.4.39 Date.prototype.toLocaleString ( [ reserved1 [ , reserved2 ] ] ) An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in ECMA-402. Otherwise, the following specification of this method is used: This method returns a String value. The contents of the String are implementation-defined, but are intended to represent the Date in the current time zone in a convenient, human-readable form that corresponds to the conventions of the host environment's current locale. The meaning of the optional parameters to this method are defined in ECMA-402; implementations that do not include ECMA-402 support must not use those parameter positions for anything else. 21.4.4.40 Date.prototype.toLocaleTimeString ( [ reserved1 [ , reserved2 ] ] ) An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in ECMA-402. Otherwise, the following specification of this method is used: This method returns a String value. The contents of the String are implementation-defined, but are intended to represent the “time” portion of the Date in the current time zone in a convenient, human-readable form that corresponds to the conventions of the host environment's current locale. The meaning of the optional parameters to this method are defined in ECMA-402; implementations that do not include ECMA-402 support must not use those parameter positions for anything else. 21.4.4.41 Date.prototype.toString ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. Return ToDateString(tv). Note 1 For any Date d such that d.[[DateValue]] is evenly divisible by 1000, the result of Date.parse(d.toString()) = d.valueOf(). See 21.4.3.2. Note 2 This method is not generic; it throws a TypeError exception if its this value is not a Date. Therefore, it cannot be transferred to other kinds of objects for use as a method. 21.4.4.41.1 TimeString ( tv ) The abstract operation TimeString takes argument tv (a Number, but not NaN) and returns a String. It performs the following steps when called: Let hour be ToZeroPaddedDecimalString(HourFromTime(tv), 2). Let minute be ToZeroPaddedDecimalString(MinuteFromTime(tv), 2). Let second be ToZeroPaddedDecimalString(SecondFromTime(tv), 2). Return the string-concatenation of hour, ":", minute, ":", second, the code unit 0x0020 (SPACE), and "GMT". 21.4.4.41.2 DateString ( tv ) The abstract operation DateString takes argument tv (a Number, but not NaN) and returns a String. It performs the following steps when called: Let weekday be the Name of the entry in Table 61 whose WeekDay Index = WeekDay(tv). Let month be the Name of the entry in Table 62 whose Month Index = MonthFromTime(tv). Let day be ToZeroPaddedDecimalString(DateFromTime(tv), 2). Let yv be YearFromTime(tv). If yv ≥ 0, let yearSign be the empty String; else let yearSign be "-". Let paddedYear be ToZeroPaddedDecimalString(abs(yv), 4). Return the string-concatenation of weekday, the code unit 0x0020 (SPACE), month, the code unit 0x0020 (SPACE), day, the code unit 0x0020 (SPACE), yearSign, and paddedYear. Table 61: Names of days of the week WeekDay Index Name 0 "Sun" 1 "Mon" 2 "Tue" 3 "Wed" 4 "Thu" 5 "Fri" 6 "Sat" Table 62: Names of months of the year Month Index Name 0 "Jan" 1 "Feb" 2 "Mar" 3 "Apr" 4 "May" 5 "Jun" 6 "Jul" 7 "Aug" 8 "Sep" 9 "Oct" 10 "Nov" 11 "Dec" 21.4.4.41.3 TimeZoneString ( tv ) The abstract operation TimeZoneString takes argument tv (an integral Number) and returns a String. It performs the following steps when called: Let systemTimeZoneIdentifier be SystemTimeZoneIdentifier(). If IsTimeZoneOffsetString(systemTimeZoneIdentifier) is true, then Let offsetNanoseconds be ParseTimeZoneOffsetString(systemTimeZoneIdentifier). Else, Let offsetNanoseconds be GetNamedTimeZoneOffsetNanoseconds(systemTimeZoneIdentifier, ℝ(tv) × NanosecondsPerMillisecond). Let offsetMilliseconds be truncate(offsetNanoseconds / NanosecondsPerMillisecond). If offsetMilliseconds ≥ 0, then Let offsetSign be "+". Let absOffsetMilliseconds be offsetMilliseconds. Else, Let offsetSign be "-". Let absOffsetMilliseconds be -offsetMilliseconds. Let offsetMinute be ToZeroPaddedDecimalString(MinuteFromTime(𝔽(absOffsetMilliseconds)), 2). Let offsetHour be ToZeroPaddedDecimalString(HourFromTime(𝔽(absOffsetMilliseconds)), 2). Let timeZoneName be an implementation-defined string that is either the empty String or the string-concatenation of the code unit 0x0020 (SPACE), the code unit 0x0028 (LEFT PARENTHESIS), an implementation-defined time zone name, and the code unit 0x0029 (RIGHT PARENTHESIS). Return the string-concatenation of offsetSign, offsetHour, offsetMinute, and timeZoneName. 21.4.4.41.4 ToDateString ( tv ) The abstract operation ToDateString takes argument tv (an integral Number or NaN) and returns a String. It performs the following steps when called: If tv is NaN, return "Invalid Date". Let localTime be LocalTime(tv). Return the string-concatenation of DateString(localTime), the code unit 0x0020 (SPACE), TimeString(localTime), and TimeZoneString(tv). 21.4.4.42 Date.prototype.toTimeString ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return "Invalid Date". Let localTime be LocalTime(tv). Return the string-concatenation of TimeString(localTime) and TimeZoneString(tv). 21.4.4.43 Date.prototype.toUTCString ( ) This method returns a String value representing the instant in time corresponding to the this value. The format of the String is based upon HTTP-date from RFC 7231, generalized to support the full range of times supported by ECMAScript Dates. It performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Let tv be dateObj.[[DateValue]]. If tv is NaN, return "Invalid Date". Let weekday be the Name of the entry in Table 61 whose WeekDay Index = WeekDay(tv). Let month be the Name of the entry in Table 62 whose Month Index = MonthFromTime(tv). Let day be ToZeroPaddedDecimalString(DateFromTime(tv), 2). Let yv be YearFromTime(tv). If yv ≥ 0, let yearSign be the empty String; else let yearSign be "-". Let paddedYear be ToZeroPaddedDecimalString(abs(yv), 4). Return the string-concatenation of weekday, ",", the code unit 0x0020 (SPACE), day, the code unit 0x0020 (SPACE), month, the code unit 0x0020 (SPACE), yearSign, paddedYear, the code unit 0x0020 (SPACE), and TimeString(tv). 21.4.4.44 Date.prototype.valueOf ( ) This method performs the following steps when called: Let dateObj be the this value. Perform ? RequireInternalSlot(dateObj, [[DateValue]]). Return dateObj.[[DateValue]]. 21.4.4.45 Date.prototype [ %Symbol.toPrimitive% ] ( hint ) This method is called by ECMAScript language operators to convert a Date to a primitive value. The allowed values for hint are "default", "number", and "string". Dates are unique among built-in ECMAScript object in that they treat "default" as being equivalent to "string", All other built-in ECMAScript objects treat "default" as being equivalent to "number". It performs the following steps when called: Let obj be the this value. If obj is not an Object, throw a TypeError exception. If hint is either "string" or "default", then Let tryFirst be string. Else if hint is "number", then Let tryFirst be number. Else, Throw a TypeError exception. Return ? OrdinaryToPrimitive(obj, tryFirst). This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. The value of the "name" property of this method is "[Symbol.toPrimitive]". 21.4.5 Properties of Date Instances Date instances are ordinary objects that inherit properties from the Date prototype object. Date instances also have a [[DateValue]] internal slot. The [[DateValue]] internal slot is the time value represented by this Date.